@coopenomics/factory 2025.12.2-alpha-3 → 2026.2.21-alpha-4

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.
package/dist/index.mjs CHANGED
@@ -253,9 +253,15 @@ const CooperativeSchema = {
253
253
  type: "array",
254
254
  items: memberSchema
255
255
  },
256
+ defaultBankAccount: {
257
+ type: "object",
258
+ properties: BankAccountSchema.properties,
259
+ required: BankAccountSchema.required,
260
+ additionalProperties: false
261
+ },
256
262
  ...organizationSchema.properties
257
263
  },
258
- required: [...organizationSchema.required, "is_branched", "registration", "initial", "minimum", "org_registration", "org_initial", "org_minimum", "members", "totalMembers", "chairman"],
264
+ required: [...organizationSchema.required, "is_branched", "registration", "initial", "minimum", "org_registration", "org_initial", "org_minimum", "members", "totalMembers", "chairman", "defaultBankAccount"],
259
265
  additionalProperties: true
260
266
  };
261
267
 
@@ -277,6 +283,7 @@ const VarsSchema = {
277
283
  passport_request: { type: "string" },
278
284
  wallet_agreement: {
279
285
  type: "object",
286
+ nullable: true,
280
287
  properties: {
281
288
  protocol_number: { type: "string" },
282
289
  protocol_day_month_year: { type: "string" }
@@ -286,6 +293,7 @@ const VarsSchema = {
286
293
  },
287
294
  privacy_agreement: {
288
295
  type: "object",
296
+ nullable: true,
289
297
  properties: {
290
298
  protocol_number: { type: "string" },
291
299
  protocol_day_month_year: { type: "string" }
@@ -295,6 +303,7 @@ const VarsSchema = {
295
303
  },
296
304
  signature_agreement: {
297
305
  type: "object",
306
+ nullable: true,
298
307
  properties: {
299
308
  protocol_number: { type: "string" },
300
309
  protocol_day_month_year: { type: "string" }
@@ -304,6 +313,7 @@ const VarsSchema = {
304
313
  },
305
314
  user_agreement: {
306
315
  type: "object",
316
+ nullable: true,
307
317
  properties: {
308
318
  protocol_number: { type: "string" },
309
319
  protocol_day_month_year: { type: "string" }
@@ -313,6 +323,7 @@ const VarsSchema = {
313
323
  },
314
324
  participant_application: {
315
325
  type: "object",
326
+ nullable: true,
316
327
  properties: {
317
328
  protocol_number: { type: "string" },
318
329
  protocol_day_month_year: { type: "string" }
@@ -330,17 +341,55 @@ const VarsSchema = {
330
341
  additionalProperties: true,
331
342
  nullable: true
332
343
  },
333
- investment_agreement: {
344
+ generation_contract_template: {
334
345
  type: "object",
335
346
  properties: {
336
347
  protocol_number: { type: "string" },
337
- protocol_day_month_year: { type: "string" },
338
- subject: { type: "string" },
339
- terms: { type: "string" }
348
+ protocol_day_month_year: { type: "string" }
340
349
  },
341
350
  required: ["protocol_day_month_year", "protocol_number"],
342
351
  additionalProperties: true,
343
352
  nullable: true
353
+ },
354
+ blagorost_program: {
355
+ type: "object",
356
+ nullable: true,
357
+ properties: {
358
+ protocol_number: { type: "string" },
359
+ protocol_day_month_year: { type: "string" }
360
+ },
361
+ required: ["protocol_number", "protocol_day_month_year"],
362
+ additionalProperties: true
363
+ },
364
+ blagorost_offer_template: {
365
+ type: "object",
366
+ nullable: true,
367
+ properties: {
368
+ protocol_number: { type: "string" },
369
+ protocol_day_month_year: { type: "string" }
370
+ },
371
+ required: ["protocol_number", "protocol_day_month_year"],
372
+ additionalProperties: true
373
+ },
374
+ generator_program: {
375
+ type: "object",
376
+ nullable: true,
377
+ properties: {
378
+ protocol_number: { type: "string" },
379
+ protocol_day_month_year: { type: "string" }
380
+ },
381
+ required: ["protocol_number", "protocol_day_month_year"],
382
+ additionalProperties: true
383
+ },
384
+ generator_offer_template: {
385
+ type: "object",
386
+ nullable: true,
387
+ properties: {
388
+ protocol_number: { type: "string" },
389
+ protocol_day_month_year: { type: "string" }
390
+ },
391
+ required: ["protocol_number", "protocol_day_month_year"],
392
+ additionalProperties: true
344
393
  }
345
394
  },
346
395
  required: [
@@ -356,11 +405,18 @@ const VarsSchema = {
356
405
  "name",
357
406
  "confidential_link",
358
407
  "confidential_email",
359
- "contact_email",
360
- "wallet_agreement",
361
- "privacy_agreement",
362
- "signature_agreement",
363
- "user_agreement"
408
+ "contact_email"
409
+ // 'wallet_agreement', //not_required
410
+ // 'signature_agreement', //not_required
411
+ // 'privacy_agreement', //not_required
412
+ // 'user_agreement', //not_required
413
+ // 'participant_application', //not_required
414
+ // 'coopenomics_agreement', //not_required
415
+ // 'generation_contract_template', //not_required
416
+ // 'blagorost_program', //not_required
417
+ // 'blagorost_offer_template', //not_required
418
+ // 'generator_program', //not_required
419
+ // 'generator_offer_template', //not_required
364
420
  ],
365
421
  additionalProperties: true
366
422
  };
@@ -612,9 +668,11 @@ const CommonUserSchema = {
612
668
  properties: {
613
669
  full_name_or_short_name: { type: "string" },
614
670
  birthdate_or_ogrn: { type: "string" },
615
- abbr_full_name: { type: "string" }
671
+ abbr_full_name: { type: "string" },
672
+ email: { type: "string" },
673
+ phone: { type: "string" }
616
674
  },
617
- required: ["full_name_or_short_name", "birthdate_or_ogrn", "abbr_full_name"],
675
+ required: ["full_name_or_short_name", "birthdate_or_ogrn", "abbr_full_name", "email", "phone"],
618
676
  additionalProperties: true
619
677
  };
620
678
 
@@ -644,8 +702,23 @@ const AgendaQuestionSchema = {
644
702
  additionalProperties: true
645
703
  };
646
704
 
647
- const registry_id$L = Cooperative$1.Registry.WalletAgreement.registry_id;
648
- const Schema$L = {
705
+ const udataSchema = {
706
+ type: "object",
707
+ properties: {
708
+ coopname: { type: "string" },
709
+ username: { type: "string" },
710
+ key: { type: "string" },
711
+ value: { type: "string" },
712
+ metadata: { type: "object", nullable: true },
713
+ deleted: { type: "boolean", nullable: true },
714
+ block_num: { type: "number", nullable: true }
715
+ },
716
+ required: ["coopname", "username", "key", "value"],
717
+ additionalProperties: true
718
+ };
719
+
720
+ const registry_id$W = Cooperative$1.Registry.WalletAgreement.registry_id;
721
+ const Schema$W = {
649
722
  type: "object",
650
723
  properties: {
651
724
  meta: IMetaJSONSchema,
@@ -655,23 +728,23 @@ const Schema$L = {
655
728
  required: ["meta", "coop", "vars"],
656
729
  additionalProperties: true
657
730
  };
658
- const Template$L = {
731
+ const Template$W = {
659
732
  title: Cooperative$1.Registry.WalletAgreement.title,
660
733
  description: Cooperative$1.Registry.WalletAgreement.description,
661
- model: Schema$L,
734
+ model: Schema$W,
662
735
  context: Cooperative$1.Registry.WalletAgreement.context,
663
736
  translations: Cooperative$1.Registry.WalletAgreement.translations
664
737
  };
665
738
 
666
739
  const WalletAgreement = {
667
740
  __proto__: null,
668
- Schema: Schema$L,
669
- Template: Template$L,
670
- registry_id: registry_id$L
741
+ Schema: Schema$W,
742
+ Template: Template$W,
743
+ registry_id: registry_id$W
671
744
  };
672
745
 
673
- const registry_id$K = Cooperative$1.Registry.RegulationElectronicSignature.registry_id;
674
- const Schema$K = {
746
+ const registry_id$V = Cooperative$1.Registry.RegulationElectronicSignature.registry_id;
747
+ const Schema$V = {
675
748
  type: "object",
676
749
  properties: {
677
750
  meta: IMetaJSONSchema,
@@ -681,23 +754,23 @@ const Schema$K = {
681
754
  required: ["meta", "coop", "vars"],
682
755
  additionalProperties: true
683
756
  };
684
- const Template$K = {
757
+ const Template$V = {
685
758
  title: Cooperative$1.Registry.RegulationElectronicSignature.title,
686
759
  description: Cooperative$1.Registry.RegulationElectronicSignature.description,
687
- model: Schema$K,
760
+ model: Schema$V,
688
761
  context: Cooperative$1.Registry.RegulationElectronicSignature.context,
689
762
  translations: Cooperative$1.Registry.RegulationElectronicSignature.translations
690
763
  };
691
764
 
692
765
  const RegulationElectronicSignaturet = {
693
766
  __proto__: null,
694
- Schema: Schema$K,
695
- Template: Template$K,
696
- registry_id: registry_id$K
767
+ Schema: Schema$V,
768
+ Template: Template$V,
769
+ registry_id: registry_id$V
697
770
  };
698
771
 
699
- const registry_id$J = Cooperative$1.Registry.PrivacyPolicy.registry_id;
700
- const Schema$J = {
772
+ const registry_id$U = Cooperative$1.Registry.PrivacyPolicy.registry_id;
773
+ const Schema$U = {
701
774
  type: "object",
702
775
  properties: {
703
776
  meta: IMetaJSONSchema,
@@ -707,23 +780,23 @@ const Schema$J = {
707
780
  required: ["meta", "coop", "vars"],
708
781
  additionalProperties: true
709
782
  };
710
- const Template$J = {
783
+ const Template$U = {
711
784
  title: Cooperative$1.Registry.PrivacyPolicy.title,
712
785
  description: Cooperative$1.Registry.PrivacyPolicy.description,
713
- model: Schema$J,
786
+ model: Schema$U,
714
787
  context: Cooperative$1.Registry.PrivacyPolicy.context,
715
788
  translations: Cooperative$1.Registry.PrivacyPolicy.translations
716
789
  };
717
790
 
718
791
  const PrivacyPolicy = {
719
792
  __proto__: null,
720
- Schema: Schema$J,
721
- Template: Template$J,
722
- registry_id: registry_id$J
793
+ Schema: Schema$U,
794
+ Template: Template$U,
795
+ registry_id: registry_id$U
723
796
  };
724
797
 
725
- const registry_id$I = Cooperative$1.Registry.UserAgreement.registry_id;
726
- const Schema$I = {
798
+ const registry_id$T = Cooperative$1.Registry.UserAgreement.registry_id;
799
+ const Schema$T = {
727
800
  type: "object",
728
801
  properties: {
729
802
  meta: IMetaJSONSchema,
@@ -740,23 +813,23 @@ const Schema$I = {
740
813
  required: ["meta", "coop", "vars", "user"],
741
814
  additionalProperties: true
742
815
  };
743
- const Template$I = {
816
+ const Template$T = {
744
817
  title: Cooperative$1.Registry.UserAgreement.title,
745
818
  description: Cooperative$1.Registry.UserAgreement.description,
746
- model: Schema$I,
819
+ model: Schema$T,
747
820
  context: Cooperative$1.Registry.UserAgreement.context,
748
821
  translations: Cooperative$1.Registry.UserAgreement.translations
749
822
  };
750
823
 
751
824
  const UserAgreement = {
752
825
  __proto__: null,
753
- Schema: Schema$I,
754
- Template: Template$I,
755
- registry_id: registry_id$I
826
+ Schema: Schema$T,
827
+ Template: Template$T,
828
+ registry_id: registry_id$T
756
829
  };
757
830
 
758
- const registry_id$H = Cooperative$1.Registry.CoopenomicsAgreement.registry_id;
759
- const Schema$H = {
831
+ const registry_id$S = Cooperative$1.Registry.CoopenomicsAgreement.registry_id;
832
+ const Schema$S = {
760
833
  type: "object",
761
834
  properties: {
762
835
  meta: IMetaJSONSchema,
@@ -767,23 +840,23 @@ const Schema$H = {
767
840
  required: ["meta", "coop", "vars", "partner"],
768
841
  additionalProperties: true
769
842
  };
770
- const Template$H = {
843
+ const Template$S = {
771
844
  title: Cooperative$1.Registry.CoopenomicsAgreement.title,
772
845
  description: Cooperative$1.Registry.CoopenomicsAgreement.description,
773
- model: Schema$H,
846
+ model: Schema$S,
774
847
  context: Cooperative$1.Registry.CoopenomicsAgreement.context,
775
848
  translations: Cooperative$1.Registry.CoopenomicsAgreement.translations
776
849
  };
777
850
 
778
851
  const CoopenomicsAgreement = {
779
852
  __proto__: null,
780
- Schema: Schema$H,
781
- Template: Template$H,
782
- registry_id: registry_id$H
853
+ Schema: Schema$S,
854
+ Template: Template$S,
855
+ registry_id: registry_id$S
783
856
  };
784
857
 
785
- const registry_id$G = Cooperative$1.Registry.ConvertToAxonStatement.registry_id;
786
- const Schema$G = {
858
+ const registry_id$R = Cooperative$1.Registry.ConvertToAxonStatement.registry_id;
859
+ const Schema$R = {
787
860
  type: "object",
788
861
  properties: {
789
862
  meta: {
@@ -808,23 +881,23 @@ const Schema$G = {
808
881
  required: ["meta", "vars", "coop", "commonUser"],
809
882
  additionalProperties: true
810
883
  };
811
- const Template$G = {
884
+ const Template$R = {
812
885
  title: Cooperative$1.Registry.ConvertToAxonStatement.title,
813
886
  description: Cooperative$1.Registry.ConvertToAxonStatement.description,
814
- model: Schema$G,
887
+ model: Schema$R,
815
888
  context: Cooperative$1.Registry.ConvertToAxonStatement.context,
816
889
  translations: Cooperative$1.Registry.ConvertToAxonStatement.translations
817
890
  };
818
891
 
819
892
  const ConvertToAxonStatement = {
820
893
  __proto__: null,
821
- Schema: Schema$G,
822
- Template: Template$G,
823
- registry_id: registry_id$G
894
+ Schema: Schema$R,
895
+ Template: Template$R,
896
+ registry_id: registry_id$R
824
897
  };
825
898
 
826
- const registry_id$F = Cooperative$1.Registry.ParticipantApplication.registry_id;
827
- const Schema$F = {
899
+ const registry_id$Q = Cooperative$1.Registry.ParticipantApplication.registry_id;
900
+ const Schema$Q = {
828
901
  type: "object",
829
902
  properties: {
830
903
  type: {
@@ -913,23 +986,23 @@ const Schema$F = {
913
986
  required: ["meta", "coop", "type"],
914
987
  additionalProperties: true
915
988
  };
916
- const Template$F = {
989
+ const Template$Q = {
917
990
  title: Cooperative$1.Registry.ParticipantApplication.title,
918
991
  description: Cooperative$1.Registry.ParticipantApplication.description,
919
- model: Schema$F,
992
+ model: Schema$Q,
920
993
  context: Cooperative$1.Registry.ParticipantApplication.context,
921
994
  translations: Cooperative$1.Registry.ParticipantApplication.translations
922
995
  };
923
996
 
924
997
  const ParticipantApplication = {
925
998
  __proto__: null,
926
- Schema: Schema$F,
927
- Template: Template$F,
928
- registry_id: registry_id$F
999
+ Schema: Schema$Q,
1000
+ Template: Template$Q,
1001
+ registry_id: registry_id$Q
929
1002
  };
930
1003
 
931
- const registry_id$E = Cooperative$1.Registry.DecisionOfParticipantApplication.registry_id;
932
- const Schema$E = {
1004
+ const registry_id$P = Cooperative$1.Registry.DecisionOfParticipantApplication.registry_id;
1005
+ const Schema$P = {
933
1006
  type: "object",
934
1007
  properties: {
935
1008
  type: {
@@ -993,23 +1066,23 @@ const Schema$E = {
993
1066
  // vars не добавляем в обязательные параметры для обратной совместимости (начиная с 2.26)
994
1067
  additionalProperties: true
995
1068
  };
996
- const Template$E = {
1069
+ const Template$P = {
997
1070
  title: Cooperative$1.Registry.DecisionOfParticipantApplication.title,
998
1071
  description: Cooperative$1.Registry.DecisionOfParticipantApplication.description,
999
- model: Schema$E,
1072
+ model: Schema$P,
1000
1073
  context: Cooperative$1.Registry.DecisionOfParticipantApplication.context,
1001
1074
  translations: Cooperative$1.Registry.DecisionOfParticipantApplication.translations
1002
1075
  };
1003
1076
 
1004
1077
  const DecisionOfParticipantApplication = {
1005
1078
  __proto__: null,
1006
- Schema: Schema$E,
1007
- Template: Template$E,
1008
- registry_id: registry_id$E
1079
+ Schema: Schema$P,
1080
+ Template: Template$P,
1081
+ registry_id: registry_id$P
1009
1082
  };
1010
1083
 
1011
- const registry_id$D = Cooperative$1.Registry.SelectBranchStatement.registry_id;
1012
- const Schema$D = {
1084
+ const registry_id$O = Cooperative$1.Registry.SelectBranchStatement.registry_id;
1085
+ const Schema$O = {
1013
1086
  type: "object",
1014
1087
  properties: {
1015
1088
  type: {
@@ -1072,23 +1145,23 @@ const Schema$D = {
1072
1145
  required: ["meta", "type", "branch", "vars", "coop"],
1073
1146
  additionalProperties: true
1074
1147
  };
1075
- const Template$D = {
1148
+ const Template$O = {
1076
1149
  title: Cooperative$1.Registry.SelectBranchStatement.title,
1077
1150
  description: Cooperative$1.Registry.SelectBranchStatement.description,
1078
- model: Schema$D,
1151
+ model: Schema$O,
1079
1152
  context: Cooperative$1.Registry.SelectBranchStatement.context,
1080
1153
  translations: Cooperative$1.Registry.SelectBranchStatement.translations
1081
1154
  };
1082
1155
 
1083
1156
  const SelectBranchStatement = {
1084
1157
  __proto__: null,
1085
- Schema: Schema$D,
1086
- Template: Template$D,
1087
- registry_id: registry_id$D
1158
+ Schema: Schema$O,
1159
+ Template: Template$O,
1160
+ registry_id: registry_id$O
1088
1161
  };
1089
1162
 
1090
- const registry_id$C = Cooperative$1.Registry.ProjectFreeDecision.registry_id;
1091
- const Schema$C = {
1163
+ const registry_id$N = Cooperative$1.Registry.ProjectFreeDecision.registry_id;
1164
+ const Schema$N = {
1092
1165
  type: "object",
1093
1166
  properties: {
1094
1167
  coop: {
@@ -1111,6 +1184,7 @@ const Schema$C = {
1111
1184
  type: "object",
1112
1185
  properties: {
1113
1186
  id: { type: "string" },
1187
+ title: { type: "string", nullable: true, maxLength: 200 },
1114
1188
  question: { type: "string" },
1115
1189
  decision: { type: "string" }
1116
1190
  },
@@ -1123,23 +1197,23 @@ const Schema$C = {
1123
1197
  required: ["meta", "coop", "project", "suggester_name", "vars"],
1124
1198
  additionalProperties: true
1125
1199
  };
1126
- const Template$C = {
1200
+ const Template$N = {
1127
1201
  title: Cooperative$1.Registry.ProjectFreeDecision.title,
1128
1202
  description: Cooperative$1.Registry.ProjectFreeDecision.description,
1129
- model: Schema$C,
1203
+ model: Schema$N,
1130
1204
  context: Cooperative$1.Registry.ProjectFreeDecision.context,
1131
1205
  translations: Cooperative$1.Registry.ProjectFreeDecision.translations
1132
1206
  };
1133
1207
 
1134
1208
  const ProjectFreeDecision = {
1135
1209
  __proto__: null,
1136
- Schema: Schema$C,
1137
- Template: Template$C,
1138
- registry_id: registry_id$C
1210
+ Schema: Schema$N,
1211
+ Template: Template$N,
1212
+ registry_id: registry_id$N
1139
1213
  };
1140
1214
 
1141
- const registry_id$B = Cooperative$1.Registry.FreeDecision.registry_id;
1142
- const Schema$B = {
1215
+ const registry_id$M = Cooperative$1.Registry.FreeDecision.registry_id;
1216
+ const Schema$M = {
1143
1217
  type: "object",
1144
1218
  properties: {
1145
1219
  coop: {
@@ -1170,6 +1244,7 @@ const Schema$B = {
1170
1244
  type: "object",
1171
1245
  properties: {
1172
1246
  id: { type: "string" },
1247
+ title: { type: "string", nullable: true },
1173
1248
  question: { type: "string" },
1174
1249
  decision: { type: "string" }
1175
1250
  },
@@ -1182,19 +1257,19 @@ const Schema$B = {
1182
1257
  // vars не вносим для обратной совместимости начиная с версии 2.25
1183
1258
  additionalProperties: true
1184
1259
  };
1185
- const Template$B = {
1260
+ const Template$M = {
1186
1261
  title: Cooperative$1.Registry.FreeDecision.title,
1187
1262
  description: Cooperative$1.Registry.FreeDecision.description,
1188
- model: Schema$B,
1263
+ model: Schema$M,
1189
1264
  context: Cooperative$1.Registry.FreeDecision.context,
1190
1265
  translations: Cooperative$1.Registry.FreeDecision.translations
1191
1266
  };
1192
1267
 
1193
1268
  const FreeDecision = {
1194
1269
  __proto__: null,
1195
- Schema: Schema$B,
1196
- Template: Template$B,
1197
- registry_id: registry_id$B
1270
+ Schema: Schema$M,
1271
+ Template: Template$M,
1272
+ registry_id: registry_id$M
1198
1273
  };
1199
1274
 
1200
1275
  const CommonRequestSchema = {
@@ -1224,8 +1299,8 @@ const CommonRequestSchema = {
1224
1299
  additionalProperties: true
1225
1300
  };
1226
1301
 
1227
- const registry_id$A = Cooperative$1.Registry.AssetContributionStatement.registry_id;
1228
- const Schema$A = {
1302
+ const registry_id$L = Cooperative$1.Registry.AssetContributionStatement.registry_id;
1303
+ const Schema$L = {
1229
1304
  type: "object",
1230
1305
  properties: {
1231
1306
  meta: IMetaJSONSchema,
@@ -1237,23 +1312,23 @@ const Schema$A = {
1237
1312
  required: ["meta", "coop", "vars", "request", "user"],
1238
1313
  additionalProperties: true
1239
1314
  };
1240
- const Template$A = {
1315
+ const Template$L = {
1241
1316
  title: Cooperative$1.Registry.AssetContributionStatement.title,
1242
1317
  description: Cooperative$1.Registry.AssetContributionStatement.description,
1243
- model: Schema$A,
1318
+ model: Schema$L,
1244
1319
  context: Cooperative$1.Registry.AssetContributionStatement.context,
1245
1320
  translations: Cooperative$1.Registry.AssetContributionStatement.translations
1246
1321
  };
1247
1322
 
1248
1323
  const AssetContributionStatement = {
1249
1324
  __proto__: null,
1250
- Schema: Schema$A,
1251
- Template: Template$A,
1252
- registry_id: registry_id$A
1325
+ Schema: Schema$L,
1326
+ Template: Template$L,
1327
+ registry_id: registry_id$L
1253
1328
  };
1254
1329
 
1255
- const registry_id$z = Cooperative$1.Registry.ReturnByAssetStatement.registry_id;
1256
- const Schema$z = {
1330
+ const registry_id$K = Cooperative$1.Registry.ReturnByAssetStatement.registry_id;
1331
+ const Schema$K = {
1257
1332
  type: "object",
1258
1333
  properties: {
1259
1334
  meta: IMetaJSONSchema,
@@ -1265,23 +1340,23 @@ const Schema$z = {
1265
1340
  required: ["meta", "coop", "vars", "request", "user"],
1266
1341
  additionalProperties: true
1267
1342
  };
1268
- const Template$z = {
1343
+ const Template$K = {
1269
1344
  title: Cooperative$1.Registry.ReturnByAssetStatement.title,
1270
1345
  description: Cooperative$1.Registry.ReturnByAssetStatement.description,
1271
- model: Schema$z,
1346
+ model: Schema$K,
1272
1347
  context: Cooperative$1.Registry.ReturnByAssetStatement.context,
1273
1348
  translations: Cooperative$1.Registry.ReturnByAssetStatement.translations
1274
1349
  };
1275
1350
 
1276
1351
  const ReturnByAssetStatement = {
1277
1352
  __proto__: null,
1278
- Schema: Schema$z,
1279
- Template: Template$z,
1280
- registry_id: registry_id$z
1353
+ Schema: Schema$K,
1354
+ Template: Template$K,
1355
+ registry_id: registry_id$K
1281
1356
  };
1282
1357
 
1283
- const registry_id$y = Cooperative$1.Registry.AssetContributionDecision.registry_id;
1284
- const Schema$y = {
1358
+ const registry_id$J = Cooperative$1.Registry.AssetContributionDecision.registry_id;
1359
+ const Schema$J = {
1285
1360
  type: "object",
1286
1361
  properties: {
1287
1362
  meta: IMetaJSONSchema,
@@ -1294,23 +1369,23 @@ const Schema$y = {
1294
1369
  required: ["meta", "coop", "vars", "request", "user", "decision"],
1295
1370
  additionalProperties: true
1296
1371
  };
1297
- const Template$y = {
1372
+ const Template$J = {
1298
1373
  title: Cooperative$1.Registry.AssetContributionDecision.title,
1299
1374
  description: Cooperative$1.Registry.AssetContributionDecision.description,
1300
- model: Schema$y,
1375
+ model: Schema$J,
1301
1376
  context: Cooperative$1.Registry.AssetContributionDecision.context,
1302
1377
  translations: Cooperative$1.Registry.AssetContributionDecision.translations
1303
1378
  };
1304
1379
 
1305
1380
  const AssetContributionDecision = {
1306
1381
  __proto__: null,
1307
- Schema: Schema$y,
1308
- Template: Template$y,
1309
- registry_id: registry_id$y
1382
+ Schema: Schema$J,
1383
+ Template: Template$J,
1384
+ registry_id: registry_id$J
1310
1385
  };
1311
1386
 
1312
- const registry_id$x = Cooperative$1.Registry.ReturnByAssetDecision.registry_id;
1313
- const Schema$x = {
1387
+ const registry_id$I = Cooperative$1.Registry.ReturnByAssetDecision.registry_id;
1388
+ const Schema$I = {
1314
1389
  type: "object",
1315
1390
  properties: {
1316
1391
  meta: IMetaJSONSchema,
@@ -1323,19 +1398,19 @@ const Schema$x = {
1323
1398
  required: ["meta", "coop", "vars", "request", "user", "decision"],
1324
1399
  additionalProperties: true
1325
1400
  };
1326
- const Template$x = {
1401
+ const Template$I = {
1327
1402
  title: Cooperative$1.Registry.ReturnByAssetDecision.title,
1328
1403
  description: Cooperative$1.Registry.ReturnByAssetDecision.description,
1329
- model: Schema$x,
1404
+ model: Schema$I,
1330
1405
  context: Cooperative$1.Registry.ReturnByAssetDecision.context,
1331
1406
  translations: Cooperative$1.Registry.ReturnByAssetDecision.translations
1332
1407
  };
1333
1408
 
1334
1409
  const ReturnByAssetDecision = {
1335
1410
  __proto__: null,
1336
- Schema: Schema$x,
1337
- Template: Template$x,
1338
- registry_id: registry_id$x
1411
+ Schema: Schema$I,
1412
+ Template: Template$I,
1413
+ registry_id: registry_id$I
1339
1414
  };
1340
1415
 
1341
1416
  const FirstLastMiddleNameSchema = {
@@ -1358,8 +1433,8 @@ const CommonProgramSchema = {
1358
1433
  additionalProperties: true
1359
1434
  };
1360
1435
 
1361
- const registry_id$w = Cooperative$1.Registry.AssetContributionAct.registry_id;
1362
- const Schema$w = {
1436
+ const registry_id$H = Cooperative$1.Registry.AssetContributionAct.registry_id;
1437
+ const Schema$H = {
1363
1438
  type: "object",
1364
1439
  properties: {
1365
1440
  meta: IMetaJSONSchema,
@@ -1376,23 +1451,23 @@ const Schema$w = {
1376
1451
  required: ["meta", "coop", "vars", "request", "user", "decision", "act_id", "receiver", "program"],
1377
1452
  additionalProperties: true
1378
1453
  };
1379
- const Template$w = {
1454
+ const Template$H = {
1380
1455
  title: Cooperative$1.Registry.AssetContributionAct.title,
1381
1456
  description: Cooperative$1.Registry.AssetContributionAct.description,
1382
- model: Schema$w,
1457
+ model: Schema$H,
1383
1458
  context: Cooperative$1.Registry.AssetContributionAct.context,
1384
1459
  translations: Cooperative$1.Registry.AssetContributionAct.translations
1385
1460
  };
1386
1461
 
1387
1462
  const AssetContributionAct = {
1388
1463
  __proto__: null,
1389
- Schema: Schema$w,
1390
- Template: Template$w,
1391
- registry_id: registry_id$w
1464
+ Schema: Schema$H,
1465
+ Template: Template$H,
1466
+ registry_id: registry_id$H
1392
1467
  };
1393
1468
 
1394
- const registry_id$v = Cooperative$1.Registry.ReturnByAssetAct.registry_id;
1395
- const Schema$v = {
1469
+ const registry_id$G = Cooperative$1.Registry.ReturnByAssetAct.registry_id;
1470
+ const Schema$G = {
1396
1471
  type: "object",
1397
1472
  properties: {
1398
1473
  meta: IMetaJSONSchema,
@@ -1409,23 +1484,23 @@ const Schema$v = {
1409
1484
  required: ["meta", "coop", "vars", "request", "user", "decision", "act_id", "transmitter", "program"],
1410
1485
  additionalProperties: true
1411
1486
  };
1412
- const Template$v = {
1487
+ const Template$G = {
1413
1488
  title: Cooperative$1.Registry.ReturnByAssetAct.title,
1414
1489
  description: Cooperative$1.Registry.ReturnByAssetAct.description,
1415
- model: Schema$v,
1490
+ model: Schema$G,
1416
1491
  context: Cooperative$1.Registry.ReturnByAssetAct.context,
1417
1492
  translations: Cooperative$1.Registry.ReturnByAssetAct.translations
1418
1493
  };
1419
1494
 
1420
1495
  const ReturnByAssetAct = {
1421
1496
  __proto__: null,
1422
- Schema: Schema$v,
1423
- Template: Template$v,
1424
- registry_id: registry_id$v
1497
+ Schema: Schema$G,
1498
+ Template: Template$G,
1499
+ registry_id: registry_id$G
1425
1500
  };
1426
1501
 
1427
- const registry_id$u = Cooperative$1.Registry.ReturnByMoney.registry_id;
1428
- const Schema$u = {
1502
+ const registry_id$F = Cooperative$1.Registry.ReturnByMoney.registry_id;
1503
+ const Schema$F = {
1429
1504
  type: "object",
1430
1505
  properties: {
1431
1506
  meta: IMetaJSONSchema,
@@ -1440,23 +1515,23 @@ const Schema$u = {
1440
1515
  required: ["meta", "coop", "vars", "user", "payment_details", "quantity", "currency", "payment_hash"],
1441
1516
  additionalProperties: false
1442
1517
  };
1443
- const Template$u = {
1518
+ const Template$F = {
1444
1519
  title: Cooperative$1.Registry.ReturnByMoney.title,
1445
1520
  description: Cooperative$1.Registry.ReturnByMoney.description,
1446
- model: Schema$u,
1521
+ model: Schema$F,
1447
1522
  context: Cooperative$1.Registry.ReturnByMoney.context,
1448
1523
  translations: Cooperative$1.Registry.ReturnByMoney.translations
1449
1524
  };
1450
1525
 
1451
1526
  const ReturnByMoney = {
1452
1527
  __proto__: null,
1453
- Schema: Schema$u,
1454
- Template: Template$u,
1455
- registry_id: registry_id$u
1528
+ Schema: Schema$F,
1529
+ Template: Template$F,
1530
+ registry_id: registry_id$F
1456
1531
  };
1457
1532
 
1458
- const registry_id$t = Cooperative$1.Registry.ReturnByMoneyDecision.registry_id;
1459
- const Schema$t = {
1533
+ const registry_id$E = Cooperative$1.Registry.ReturnByMoneyDecision.registry_id;
1534
+ const Schema$E = {
1460
1535
  type: "object",
1461
1536
  properties: {
1462
1537
  meta: {
@@ -1491,96 +1566,458 @@ const Schema$t = {
1491
1566
  required: ["meta", "coop", "decision", "user", "quantity", "currency", "vars"],
1492
1567
  additionalProperties: false
1493
1568
  };
1494
- const Template$t = {
1569
+ const Template$E = {
1495
1570
  title: Cooperative$1.Registry.ReturnByMoneyDecision.title,
1496
1571
  description: Cooperative$1.Registry.ReturnByMoneyDecision.description,
1497
- model: Schema$t,
1572
+ model: Schema$E,
1498
1573
  context: Cooperative$1.Registry.ReturnByMoneyDecision.context,
1499
1574
  translations: Cooperative$1.Registry.ReturnByMoneyDecision.translations
1500
1575
  };
1501
1576
 
1502
1577
  const ReturnByMoneyDecision = {
1503
1578
  __proto__: null,
1504
- Schema: Schema$t,
1505
- Template: Template$t,
1506
- registry_id: registry_id$t
1579
+ Schema: Schema$E,
1580
+ Template: Template$E,
1581
+ registry_id: registry_id$E
1507
1582
  };
1508
1583
 
1509
- const registry_id$s = Cooperative$1.Registry.CapitalizationAgreement.registry_id;
1510
- const Schema$s = {
1584
+ const registry_id$D = Cooperative$1.Registry.GeneratorProgramTemplate.registry_id;
1585
+ const Schema$D = {
1511
1586
  type: "object",
1512
1587
  properties: {
1513
- meta: IMetaJSONSchema
1588
+ meta: IMetaJSONSchema,
1589
+ coop: CooperativeSchema,
1590
+ vars: VarsSchema
1514
1591
  },
1515
- required: ["meta"],
1592
+ required: ["meta", "coop", "vars"],
1516
1593
  additionalProperties: true
1517
1594
  };
1518
- const Template$s = {
1519
- title: Cooperative$1.Registry.CapitalizationAgreement.title,
1520
- description: Cooperative$1.Registry.CapitalizationAgreement.description,
1521
- model: Schema$s,
1522
- context: Cooperative$1.Registry.CapitalizationAgreement.context,
1523
- translations: Cooperative$1.Registry.CapitalizationAgreement.translations
1595
+ const Template$D = {
1596
+ title: Cooperative$1.Registry.GeneratorProgramTemplate.title,
1597
+ description: Cooperative$1.Registry.GeneratorProgramTemplate.description,
1598
+ model: Schema$D,
1599
+ context: Cooperative$1.Registry.GeneratorProgramTemplate.context,
1600
+ translations: Cooperative$1.Registry.GeneratorProgramTemplate.translations
1524
1601
  };
1525
1602
 
1526
- const CapitalizationAgreement = {
1603
+ const GeneratorProgramTemplate = {
1527
1604
  __proto__: null,
1528
- Schema: Schema$s,
1529
- Template: Template$s,
1530
- registry_id: registry_id$s
1605
+ Schema: Schema$D,
1606
+ Template: Template$D,
1607
+ registry_id: registry_id$D
1531
1608
  };
1532
1609
 
1533
- const registry_id$r = Cooperative$1.Registry.GenerationAgreement.registry_id;
1534
- const Schema$r = {
1610
+ const registry_id$C = Cooperative$1.Registry.GeneratorOfferTemplate.registry_id;
1611
+ const Schema$C = {
1535
1612
  type: "object",
1536
1613
  properties: {
1537
1614
  meta: IMetaJSONSchema,
1538
- coop: CooperativeSchema
1615
+ coop: CooperativeSchema,
1616
+ vars: VarsSchema,
1617
+ common_user: CommonUserSchema
1539
1618
  },
1540
- required: ["meta", "coop"],
1619
+ required: ["meta", "coop", "vars", "common_user"],
1541
1620
  additionalProperties: true
1542
1621
  };
1543
- const Template$r = {
1544
- title: Cooperative$1.Registry.GenerationAgreement.title,
1545
- description: Cooperative$1.Registry.GenerationAgreement.description,
1546
- model: Schema$r,
1547
- context: Cooperative$1.Registry.GenerationAgreement.context,
1548
- translations: Cooperative$1.Registry.GenerationAgreement.translations
1622
+ const Template$C = {
1623
+ title: Cooperative$1.Registry.GeneratorOfferTemplate.title,
1624
+ description: Cooperative$1.Registry.GeneratorOfferTemplate.description,
1625
+ model: Schema$C,
1626
+ context: Cooperative$1.Registry.GeneratorOfferTemplate.context,
1627
+ translations: Cooperative$1.Registry.GeneratorOfferTemplate.translations
1549
1628
  };
1550
1629
 
1551
- const GenerationAgreement = {
1630
+ const GeneratorOfferTemplate = {
1552
1631
  __proto__: null,
1553
- Schema: Schema$r,
1554
- Template: Template$r,
1555
- registry_id: registry_id$r
1632
+ Schema: Schema$C,
1633
+ Template: Template$C,
1634
+ registry_id: registry_id$C
1556
1635
  };
1557
1636
 
1558
- const registry_id$q = Cooperative$1.Registry.AppendixGenerationAgreement.registry_id;
1559
- const Schema$q = {
1637
+ const registry_id$B = Cooperative$1.Registry.GeneratorOffer.registry_id;
1638
+ const Schema$B = {
1560
1639
  type: "object",
1561
1640
  properties: {
1562
- meta: IMetaJSONSchema
1641
+ meta: IMetaJSONSchema,
1642
+ coop: CooperativeSchema,
1643
+ vars: VarsSchema,
1644
+ common_user: CommonUserSchema,
1645
+ generator_agreement_number: { type: "string" },
1646
+ generator_agreement_created_at: { type: "string" }
1563
1647
  },
1564
- required: ["meta"],
1648
+ required: ["meta", "coop", "vars", "common_user", "generator_agreement_number", "generator_agreement_created_at"],
1565
1649
  additionalProperties: true
1566
1650
  };
1567
- const Template$q = {
1568
- title: Cooperative$1.Registry.AppendixGenerationAgreement.title,
1569
- description: Cooperative$1.Registry.AppendixGenerationAgreement.description,
1570
- model: Schema$q,
1571
- context: Cooperative$1.Registry.AppendixGenerationAgreement.context,
1572
- translations: Cooperative$1.Registry.AppendixGenerationAgreement.translations
1651
+ const Template$B = {
1652
+ title: Cooperative$1.Registry.GeneratorOffer.title,
1653
+ description: Cooperative$1.Registry.GeneratorOffer.description,
1654
+ model: Schema$B,
1655
+ context: Cooperative$1.Registry.GeneratorOffer.context,
1656
+ translations: Cooperative$1.Registry.GeneratorOffer.translations
1573
1657
  };
1574
1658
 
1575
- const AppendixGenerationAgreement = {
1659
+ const GeneratorOffer = {
1576
1660
  __proto__: null,
1577
- Schema: Schema$q,
1578
- Template: Template$q,
1579
- registry_id: registry_id$q
1661
+ Schema: Schema$B,
1662
+ Template: Template$B,
1663
+ registry_id: registry_id$B
1580
1664
  };
1581
1665
 
1582
- const registry_id$p = Cooperative$1.Registry.ExpenseStatement.registry_id;
1583
- const Schema$p = {
1666
+ const registry_id$A = Cooperative$1.Registry.BlagorostProgramTemplate.registry_id;
1667
+ const Schema$A = {
1668
+ type: "object",
1669
+ properties: {
1670
+ meta: IMetaJSONSchema,
1671
+ vars: VarsSchema
1672
+ },
1673
+ required: ["meta", "vars"],
1674
+ additionalProperties: true
1675
+ };
1676
+ const Template$A = {
1677
+ title: Cooperative$1.Registry.BlagorostProgramTemplate.title,
1678
+ description: Cooperative$1.Registry.BlagorostProgramTemplate.description,
1679
+ model: Schema$A,
1680
+ context: Cooperative$1.Registry.BlagorostProgramTemplate.context,
1681
+ translations: Cooperative$1.Registry.BlagorostProgramTemplate.translations
1682
+ };
1683
+
1684
+ const BlagorostProgramTemplate = {
1685
+ __proto__: null,
1686
+ Schema: Schema$A,
1687
+ Template: Template$A,
1688
+ registry_id: registry_id$A
1689
+ };
1690
+
1691
+ const registry_id$z = Cooperative$1.Registry.GenerationContractTemplate.registry_id;
1692
+ const Schema$z = {
1693
+ type: "object",
1694
+ properties: {
1695
+ meta: IMetaJSONSchema,
1696
+ coop: CooperativeSchema,
1697
+ vars: VarsSchema
1698
+ },
1699
+ required: ["meta", "coop", "vars"],
1700
+ additionalProperties: true
1701
+ };
1702
+ const Template$z = {
1703
+ title: Cooperative$1.Registry.GenerationContractTemplate.title,
1704
+ description: Cooperative$1.Registry.GenerationContractTemplate.description,
1705
+ model: Schema$z,
1706
+ context: Cooperative$1.Registry.GenerationContractTemplate.context,
1707
+ translations: Cooperative$1.Registry.GenerationContractTemplate.translations
1708
+ };
1709
+
1710
+ const GenerationContractTemplate = {
1711
+ __proto__: null,
1712
+ Schema: Schema$z,
1713
+ Template: Template$z,
1714
+ registry_id: registry_id$z
1715
+ };
1716
+
1717
+ const registry_id$y = Cooperative$1.Registry.BlagorostOfferTemplate.registry_id;
1718
+ const Schema$y = {
1719
+ type: "object",
1720
+ properties: {
1721
+ meta: IMetaJSONSchema,
1722
+ coop: CooperativeSchema,
1723
+ vars: VarsSchema
1724
+ },
1725
+ required: ["meta", "coop", "vars"],
1726
+ additionalProperties: true
1727
+ };
1728
+ const Template$y = {
1729
+ title: Cooperative$1.Registry.BlagorostOfferTemplate.title,
1730
+ description: Cooperative$1.Registry.BlagorostOfferTemplate.description,
1731
+ model: Schema$y,
1732
+ context: Cooperative$1.Registry.BlagorostOfferTemplate.context,
1733
+ translations: Cooperative$1.Registry.BlagorostOfferTemplate.translations
1734
+ };
1735
+
1736
+ const BlagorostOfferTemplate = {
1737
+ __proto__: null,
1738
+ Schema: Schema$y,
1739
+ Template: Template$y,
1740
+ registry_id: registry_id$y
1741
+ };
1742
+
1743
+ const registry_id$x = Cooperative$1.Registry.BlagorostOffer.registry_id;
1744
+ const Schema$x = {
1745
+ type: "object",
1746
+ properties: {
1747
+ meta: IMetaJSONSchema,
1748
+ coop: CooperativeSchema,
1749
+ vars: VarsSchema,
1750
+ common_user: CommonUserSchema,
1751
+ blagorost_agreement_number: { type: "string" },
1752
+ blagorost_agreement_created_at: { type: "string" }
1753
+ },
1754
+ required: ["meta", "coop", "vars", "common_user", "blagorost_agreement_number", "blagorost_agreement_created_at"],
1755
+ additionalProperties: true
1756
+ };
1757
+ const Template$x = {
1758
+ title: Cooperative$1.Registry.BlagorostOffer.title,
1759
+ description: Cooperative$1.Registry.BlagorostOffer.description,
1760
+ model: Schema$x,
1761
+ context: Cooperative$1.Registry.BlagorostOffer.context,
1762
+ translations: Cooperative$1.Registry.BlagorostOffer.translations
1763
+ };
1764
+
1765
+ const BlagorostOffer = {
1766
+ __proto__: null,
1767
+ Schema: Schema$x,
1768
+ Template: Template$x,
1769
+ registry_id: registry_id$x
1770
+ };
1771
+
1772
+ const registry_id$w = Cooperative$1.Registry.GenerationContract.registry_id;
1773
+ const Schema$w = {
1774
+ type: "object",
1775
+ properties: {
1776
+ meta: IMetaJSONSchema,
1777
+ coop: CooperativeSchema,
1778
+ vars: VarsSchema,
1779
+ user: CommonUserSchema,
1780
+ contributor_contract_number: { type: "string" }
1781
+ },
1782
+ required: ["meta", "coop", "vars", "user", "contributor_contract_number"],
1783
+ additionalProperties: true
1784
+ };
1785
+ const Template$w = {
1786
+ title: Cooperative$1.Registry.GenerationContract.title,
1787
+ description: Cooperative$1.Registry.GenerationContract.description,
1788
+ model: Schema$w,
1789
+ context: Cooperative$1.Registry.GenerationContract.context,
1790
+ translations: Cooperative$1.Registry.GenerationContract.translations
1791
+ };
1792
+
1793
+ const GenerationContract = {
1794
+ __proto__: null,
1795
+ Schema: Schema$w,
1796
+ Template: Template$w,
1797
+ registry_id: registry_id$w
1798
+ };
1799
+
1800
+ const registry_id$v = Cooperative$1.Registry.ProjectGenerationContract.registry_id;
1801
+ const Schema$v = {
1802
+ type: "object",
1803
+ properties: {
1804
+ meta: IMetaJSONSchema,
1805
+ coop: CooperativeSchema,
1806
+ vars: VarsSchema,
1807
+ user: CommonUserSchema,
1808
+ appendix_hash: { type: "string" },
1809
+ short_appendix_hash: { type: "string" },
1810
+ contributor_contract_number: { type: "string" },
1811
+ contributor_contract_created_at: { type: "string" },
1812
+ project_name: { type: "string" },
1813
+ project_hash: { type: "string" },
1814
+ generator_agreement_number: { type: "string" },
1815
+ generator_agreement_created_at: { type: "string" }
1816
+ },
1817
+ required: ["meta", "coop", "vars", "user", "appendix_hash", "short_appendix_hash", "contributor_contract_number", "contributor_contract_created_at", "project_name", "project_hash", "generator_agreement_number", "generator_agreement_created_at"],
1818
+ additionalProperties: true
1819
+ };
1820
+ const Template$v = {
1821
+ title: Cooperative$1.Registry.ProjectGenerationContract.title,
1822
+ description: Cooperative$1.Registry.ProjectGenerationContract.description,
1823
+ model: Schema$v,
1824
+ context: Cooperative$1.Registry.ProjectGenerationContract.context,
1825
+ translations: Cooperative$1.Registry.ProjectGenerationContract.translations
1826
+ };
1827
+
1828
+ const ProjectGenerationContract = {
1829
+ __proto__: null,
1830
+ Schema: Schema$v,
1831
+ Template: Template$v,
1832
+ registry_id: registry_id$v
1833
+ };
1834
+
1835
+ const registry_id$u = Cooperative$1.Registry.ComponentGenerationContract.registry_id;
1836
+ const Schema$u = {
1837
+ type: "object",
1838
+ properties: {
1839
+ meta: IMetaJSONSchema,
1840
+ coop: CooperativeSchema,
1841
+ vars: VarsSchema,
1842
+ user: CommonUserSchema,
1843
+ appendix_hash: { type: "string" },
1844
+ short_appendix_hash: { type: "string" },
1845
+ parent_appendix_hash: { type: "string" },
1846
+ short_parent_appendix_hash: { type: "string" },
1847
+ contributor_contract_number: { type: "string" },
1848
+ contributor_contract_created_at: { type: "string" },
1849
+ component_name: { type: "string" },
1850
+ component_hash: { type: "string" },
1851
+ project_name: { type: "string" },
1852
+ project_hash: { type: "string" }
1853
+ },
1854
+ required: ["meta", "coop", "vars", "user", "appendix_hash", "short_appendix_hash", "parent_appendix_hash", "short_parent_appendix_hash", "contributor_contract_number", "contributor_contract_created_at", "component_name", "component_hash", "project_name", "project_hash"],
1855
+ additionalProperties: true
1856
+ };
1857
+ const Template$u = {
1858
+ title: Cooperative$1.Registry.ComponentGenerationContract.title,
1859
+ description: Cooperative$1.Registry.ComponentGenerationContract.description,
1860
+ model: Schema$u,
1861
+ context: Cooperative$1.Registry.ComponentGenerationContract.context,
1862
+ translations: Cooperative$1.Registry.ComponentGenerationContract.translations
1863
+ };
1864
+
1865
+ const ComponentGenerationContract = {
1866
+ __proto__: null,
1867
+ Schema: Schema$u,
1868
+ Template: Template$u,
1869
+ registry_id: registry_id$u
1870
+ };
1871
+
1872
+ const registry_id$t = Cooperative$1.Registry.StorageAgreement.registry_id;
1873
+ const Schema$t = {
1874
+ type: "object",
1875
+ properties: {
1876
+ meta: IMetaJSONSchema,
1877
+ coop: CooperativeSchema,
1878
+ vars: VarsSchema,
1879
+ common_user: CommonUserSchema,
1880
+ blagorost_storage_agreement_number: { type: "string" },
1881
+ blagorost_storage_agreement_created_at: { type: "string" },
1882
+ contributor_contract_number: { type: "string" },
1883
+ generator_agreement_number: { type: "string" },
1884
+ generator_agreement_created_at: { type: "string" }
1885
+ },
1886
+ required: ["meta", "coop", "vars", "common_user", "blagorost_storage_agreement_number", "blagorost_storage_agreement_created_at", "contributor_contract_number", "generator_agreement_number", "generator_agreement_created_at"],
1887
+ additionalProperties: true
1888
+ };
1889
+ const Template$t = {
1890
+ title: Cooperative$1.Registry.StorageAgreement.title,
1891
+ description: Cooperative$1.Registry.StorageAgreement.description,
1892
+ model: Schema$t,
1893
+ context: Cooperative$1.Registry.StorageAgreement.context,
1894
+ translations: Cooperative$1.Registry.StorageAgreement.translations
1895
+ };
1896
+
1897
+ const StorageAgreement = {
1898
+ __proto__: null,
1899
+ Schema: Schema$t,
1900
+ Template: Template$t,
1901
+ registry_id: registry_id$t
1902
+ };
1903
+
1904
+ const registry_id$s = Cooperative$1.Registry.BlagorostAgreement.registry_id;
1905
+ const Schema$s = {
1906
+ type: "object",
1907
+ properties: {
1908
+ meta: IMetaJSONSchema,
1909
+ coop: CooperativeSchema,
1910
+ vars: VarsSchema,
1911
+ common_user: CommonUserSchema,
1912
+ blagorost_agreement_number: { type: "string" },
1913
+ contributor_contract_number: { type: "string" },
1914
+ contributor_contract_created_at: { type: "string" }
1915
+ },
1916
+ required: ["meta", "coop", "vars", "common_user", "blagorost_agreement_number", "contributor_contract_number", "contributor_contract_created_at"],
1917
+ additionalProperties: true
1918
+ };
1919
+ const Template$s = {
1920
+ title: Cooperative$1.Registry.BlagorostAgreement.title,
1921
+ description: Cooperative$1.Registry.BlagorostAgreement.description,
1922
+ model: Schema$s,
1923
+ context: Cooperative$1.Registry.BlagorostAgreement.context,
1924
+ translations: Cooperative$1.Registry.BlagorostAgreement.translations
1925
+ };
1926
+
1927
+ const BlagorostAgreement = {
1928
+ __proto__: null,
1929
+ Schema: Schema$s,
1930
+ Template: Template$s,
1931
+ registry_id: registry_id$s
1932
+ };
1933
+
1934
+ const registry_id$r = Cooperative$1.Registry.InitProjectStatement.registry_id;
1935
+ const Schema$r = {
1936
+ type: "object",
1937
+ properties: {
1938
+ meta: IMetaJSONSchema,
1939
+ coop: CooperativeSchema,
1940
+ vars: VarsSchema,
1941
+ user: CommonUserSchema,
1942
+ project_name: { type: "string" },
1943
+ project_hash: { type: "string" },
1944
+ component_name: { type: "string" },
1945
+ component_hash: { type: "string" },
1946
+ is_component: { type: "boolean" }
1947
+ },
1948
+ required: ["meta", "coop", "vars", "user", "project_name", "project_hash", "component_name", "component_hash", "is_component"],
1949
+ additionalProperties: true
1950
+ };
1951
+ const Template$r = {
1952
+ title: Cooperative$1.Registry.InitProjectStatement.title,
1953
+ description: Cooperative$1.Registry.InitProjectStatement.description,
1954
+ model: Schema$r,
1955
+ context: Cooperative$1.Registry.InitProjectStatement.context,
1956
+ translations: Cooperative$1.Registry.InitProjectStatement.translations
1957
+ };
1958
+
1959
+ const InitProjectStatement = {
1960
+ __proto__: null,
1961
+ Schema: Schema$r,
1962
+ Template: Template$r,
1963
+ registry_id: registry_id$r
1964
+ };
1965
+
1966
+ const registry_id$q = Cooperative$1.Registry.InitProjectDecision.registry_id;
1967
+ const Schema$q = {
1968
+ type: "object",
1969
+ properties: {
1970
+ coop: {
1971
+ type: "object",
1972
+ properties: {
1973
+ ...CooperativeSchema.properties
1974
+ },
1975
+ required: [...CooperativeSchema.required],
1976
+ additionalProperties: true
1977
+ },
1978
+ decision: {
1979
+ type: "object",
1980
+ properties: {
1981
+ ...decisionSchema.properties
1982
+ },
1983
+ required: [...decisionSchema.required],
1984
+ additionalProperties: true
1985
+ },
1986
+ meta: {
1987
+ type: "object",
1988
+ properties: {
1989
+ ...IMetaJSONSchema.properties
1990
+ },
1991
+ required: [...IMetaJSONSchema.required],
1992
+ additionalProperties: true
1993
+ },
1994
+ vars: VarsSchema,
1995
+ project_name: { type: "string" },
1996
+ project_hash: { type: "string" },
1997
+ component_name: { type: "string" },
1998
+ component_hash: { type: "string" },
1999
+ is_component: { type: "boolean" }
2000
+ },
2001
+ required: ["meta", "coop", "decision", "project_name", "project_hash", "component_name", "component_hash", "is_component"],
2002
+ additionalProperties: true
2003
+ };
2004
+ const Template$q = {
2005
+ title: Cooperative$1.Registry.InitProjectDecision.title,
2006
+ description: Cooperative$1.Registry.InitProjectDecision.description,
2007
+ model: Schema$q,
2008
+ context: Cooperative$1.Registry.InitProjectDecision.context,
2009
+ translations: Cooperative$1.Registry.InitProjectDecision.translations
2010
+ };
2011
+
2012
+ const InitProjectDecision = {
2013
+ __proto__: null,
2014
+ Schema: Schema$q,
2015
+ Template: Template$q,
2016
+ registry_id: registry_id$q
2017
+ };
2018
+
2019
+ const registry_id$p = Cooperative$1.Registry.ExpenseStatement.registry_id;
2020
+ const Schema$p = {
1584
2021
  type: "object",
1585
2022
  properties: {
1586
2023
  meta: IMetaJSONSchema
@@ -1631,9 +2068,35 @@ const registry_id$n = Cooperative$1.Registry.GenerationMoneyInvestStatement.regi
1631
2068
  const Schema$n = {
1632
2069
  type: "object",
1633
2070
  properties: {
1634
- meta: IMetaJSONSchema
2071
+ meta: IMetaJSONSchema,
2072
+ coop: CooperativeSchema,
2073
+ vars: VarsSchema,
2074
+ common_user: CommonUserSchema,
2075
+ appendix_hash: { type: "string" },
2076
+ short_appendix_hash: { type: "string" },
2077
+ contributor_contract_number: { type: "string" },
2078
+ contributor_contract_created_at: { type: "string" },
2079
+ appendix_created_at: { type: "string" },
2080
+ project_hash: { type: "string" },
2081
+ amount: { type: "string" },
2082
+ blagorost_agreement_number: { type: "string" },
2083
+ blagorost_agreement_created_at: { type: "string" }
1635
2084
  },
1636
- required: ["meta"],
2085
+ required: [
2086
+ "meta",
2087
+ "coop",
2088
+ "vars",
2089
+ "common_user",
2090
+ "appendix_hash",
2091
+ "short_appendix_hash",
2092
+ "contributor_contract_number",
2093
+ "contributor_contract_created_at",
2094
+ "appendix_created_at",
2095
+ "project_hash",
2096
+ "amount",
2097
+ "blagorost_agreement_number",
2098
+ "blagorost_agreement_created_at"
2099
+ ],
1637
2100
  additionalProperties: true
1638
2101
  };
1639
2102
  const Template$n = {
@@ -1655,9 +2118,17 @@ const registry_id$m = Cooperative$1.Registry.GenerationMoneyReturnUnusedStatemen
1655
2118
  const Schema$m = {
1656
2119
  type: "object",
1657
2120
  properties: {
1658
- meta: IMetaJSONSchema
2121
+ meta: IMetaJSONSchema,
2122
+ vars: VarsSchema,
2123
+ common_user: CommonUserSchema,
2124
+ contributor_contract_number: { type: "string" },
2125
+ contributor_contract_created_at: { type: "string" },
2126
+ generator_agreement_number: { type: "string" },
2127
+ generator_agreement_created_at: { type: "string" },
2128
+ project_hash: { type: "string" },
2129
+ amount: { type: "string" }
1659
2130
  },
1660
- required: ["meta"],
2131
+ required: ["meta", "vars", "common_user", "contributor_contract_number", "contributor_contract_created_at", "generator_agreement_number", "generator_agreement_created_at", "project_hash", "amount"],
1661
2132
  additionalProperties: true
1662
2133
  };
1663
2134
  const Template$m = {
@@ -1679,9 +2150,12 @@ const registry_id$l = Cooperative$1.Registry.CapitalizationMoneyInvestStatement.
1679
2150
  const Schema$l = {
1680
2151
  type: "object",
1681
2152
  properties: {
1682
- meta: IMetaJSONSchema
2153
+ meta: IMetaJSONSchema,
2154
+ vars: VarsSchema,
2155
+ common_user: CommonUserSchema,
2156
+ amount: { type: "string" }
1683
2157
  },
1684
- required: ["meta"],
2158
+ required: ["meta", "vars", "common_user", "amount"],
1685
2159
  additionalProperties: true
1686
2160
  };
1687
2161
  const Template$l = {
@@ -1703,9 +2177,22 @@ const registry_id$k = Cooperative$1.Registry.ResultContributionStatement.registr
1703
2177
  const Schema$k = {
1704
2178
  type: "object",
1705
2179
  properties: {
1706
- meta: IMetaJSONSchema
2180
+ meta: IMetaJSONSchema,
2181
+ coop: CooperativeSchema,
2182
+ vars: VarsSchema,
2183
+ common_user: CommonUserSchema,
2184
+ contributor_contract_number: { type: "string" },
2185
+ contributor_contract_created_at: { type: "string" },
2186
+ blagorost_agreement_number: { type: "string" },
2187
+ blagorost_agreement_created_at: { type: "string" },
2188
+ project_name: { type: "string" },
2189
+ component_name: { type: "string" },
2190
+ result_hash: { type: "string" },
2191
+ result_short_hash: { type: "string" },
2192
+ percent_of_result: { type: "string" },
2193
+ total_amount: { type: "string" }
1707
2194
  },
1708
- required: ["meta"],
2195
+ required: ["meta", "coop", "vars", "common_user", "contributor_contract_number", "contributor_contract_created_at", "blagorost_agreement_number", "blagorost_agreement_created_at", "project_name", "component_name", "result_hash", "result_short_hash", "percent_of_result", "total_amount"],
1709
2196
  additionalProperties: true
1710
2197
  };
1711
2198
  const Template$k = {
@@ -1727,9 +2214,23 @@ const registry_id$j = Cooperative$1.Registry.ResultContributionDecision.registry
1727
2214
  const Schema$j = {
1728
2215
  type: "object",
1729
2216
  properties: {
1730
- meta: IMetaJSONSchema
2217
+ meta: IMetaJSONSchema,
2218
+ coop: CooperativeSchema,
2219
+ vars: VarsSchema,
2220
+ decision: decisionSchema,
2221
+ common_user: CommonUserSchema,
2222
+ contributor_contract_number: { type: "string" },
2223
+ contributor_contract_created_at: { type: "string" },
2224
+ blagorost_agreement_number: { type: "string" },
2225
+ blagorost_agreement_created_at: { type: "string" },
2226
+ project_name: { type: "string" },
2227
+ component_name: { type: "string" },
2228
+ result_hash: { type: "string" },
2229
+ result_short_hash: { type: "string" },
2230
+ percent_of_result: { type: "string" },
2231
+ total_amount: { type: "string" }
1731
2232
  },
1732
- required: ["meta"],
2233
+ required: ["meta", "coop", "vars", "decision", "common_user", "contributor_contract_number", "contributor_contract_created_at", "blagorost_agreement_number", "blagorost_agreement_created_at", "project_name", "component_name", "result_hash", "result_short_hash", "percent_of_result", "total_amount"],
1733
2234
  additionalProperties: true
1734
2235
  };
1735
2236
  const Template$j = {
@@ -1751,9 +2252,22 @@ const registry_id$i = Cooperative$1.Registry.ResultContributionAct.registry_id;
1751
2252
  const Schema$i = {
1752
2253
  type: "object",
1753
2254
  properties: {
1754
- meta: IMetaJSONSchema
2255
+ meta: IMetaJSONSchema,
2256
+ coop: CooperativeSchema,
2257
+ vars: VarsSchema,
2258
+ decision: decisionSchema,
2259
+ common_user: CommonUserSchema,
2260
+ contributor_contract_number: { type: "string" },
2261
+ contributor_contract_created_at: { type: "string" },
2262
+ blagorost_agreement_number: { type: "string" },
2263
+ blagorost_agreement_created_at: { type: "string" },
2264
+ result_act_hash: { type: "string" },
2265
+ result_act_short_hash: { type: "string" },
2266
+ result_hash: { type: "string" },
2267
+ percent_of_result: { type: "string" },
2268
+ total_amount: { type: "string" }
1755
2269
  },
1756
- required: ["meta"],
2270
+ required: ["meta", "coop", "vars", "decision", "common_user", "contributor_contract_number", "contributor_contract_created_at", "blagorost_agreement_number", "blagorost_agreement_created_at", "result_act_hash", "result_act_short_hash", "result_hash", "percent_of_result", "total_amount"],
1757
2271
  additionalProperties: true
1758
2272
  };
1759
2273
  const Template$i = {
@@ -1967,9 +2481,22 @@ const registry_id$9 = Cooperative$1.Registry.GenerationToMainWalletConvertStatem
1967
2481
  const Schema$9 = {
1968
2482
  type: "object",
1969
2483
  properties: {
1970
- meta: IMetaJSONSchema
2484
+ meta: IMetaJSONSchema,
2485
+ coop: CooperativeSchema,
2486
+ vars: VarsSchema,
2487
+ common_user: CommonUserSchema,
2488
+ contributor_contract_number: { type: "string" },
2489
+ contributor_contract_created_at: { type: "string" },
2490
+ appendix_hash: { type: "string" },
2491
+ appendix_short_hash: { type: "string" },
2492
+ project_hash: { type: "string" },
2493
+ project_short_hash: { type: "string" },
2494
+ main_wallet_amount: { type: "string" },
2495
+ blagorost_wallet_amount: { type: "string" },
2496
+ to_wallet: { type: "boolean" },
2497
+ to_blagorost: { type: "boolean" }
1971
2498
  },
1972
- required: ["meta"],
2499
+ required: ["meta", "coop", "vars", "common_user", "contributor_contract_number", "contributor_contract_created_at", "appendix_hash", "appendix_short_hash", "project_hash", "project_short_hash", "main_wallet_amount", "blagorost_wallet_amount", "to_wallet", "to_blagorost"],
1973
2500
  additionalProperties: true
1974
2501
  };
1975
2502
  const Template$9 = {
@@ -2301,9 +2828,20 @@ const Registry = {
2301
2828
  802: ReturnByAssetAct,
2302
2829
  900: ReturnByMoney,
2303
2830
  901: ReturnByMoneyDecision,
2304
- 1e3: CapitalizationAgreement,
2305
- 1001: GenerationAgreement,
2306
- 1002: AppendixGenerationAgreement,
2831
+ 994: GeneratorProgramTemplate,
2832
+ 995: GeneratorOfferTemplate,
2833
+ 996: GeneratorOffer,
2834
+ 997: GenerationContractTemplate,
2835
+ 998: BlagorostProgramTemplate,
2836
+ 999: BlagorostOfferTemplate,
2837
+ 1e3: BlagorostOffer,
2838
+ 1001: GenerationContract,
2839
+ 1002: ProjectGenerationContract,
2840
+ 1003: ComponentGenerationContract,
2841
+ 1004: StorageAgreement,
2842
+ 1007: BlagorostAgreement,
2843
+ 1005: InitProjectStatement,
2844
+ 1006: InitProjectDecision,
2307
2845
  1010: ExpenseStatement,
2308
2846
  1011: ExpenseDecision,
2309
2847
  1020: GenerationMoneyInvestStatement,
@@ -2326,10 +2864,10 @@ const Registry = {
2326
2864
  1090: CapitalizationToMainWalletConvertStatement
2327
2865
  };
2328
2866
 
2329
- var __defProp$d = Object.defineProperty;
2330
- var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2331
- var __publicField$d = (obj, key, value) => {
2332
- __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
2867
+ var __defProp$e = Object.defineProperty;
2868
+ var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2869
+ var __publicField$e = (obj, key, value) => {
2870
+ __defNormalProp$e(obj, typeof key !== "symbol" ? key + "" : key, value);
2333
2871
  return value;
2334
2872
  };
2335
2873
  const ajv = new Ajv();
@@ -2340,8 +2878,8 @@ ajv.addFormat("phone", {
2340
2878
  });
2341
2879
  class Validator {
2342
2880
  constructor(schema, data) {
2343
- __publicField$d(this, "schema");
2344
- __publicField$d(this, "data");
2881
+ __publicField$e(this, "schema");
2882
+ __publicField$e(this, "data");
2345
2883
  this.schema = schema;
2346
2884
  this.data = data;
2347
2885
  }
@@ -2359,16 +2897,16 @@ class Validator {
2359
2897
  }
2360
2898
  }
2361
2899
 
2362
- var __defProp$c = Object.defineProperty;
2363
- var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2364
- var __publicField$c = (obj, key, value) => {
2365
- __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
2900
+ var __defProp$d = Object.defineProperty;
2901
+ var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2902
+ var __publicField$d = (obj, key, value) => {
2903
+ __defNormalProp$d(obj, typeof key !== "symbol" ? key + "" : key, value);
2366
2904
  return value;
2367
2905
  };
2368
2906
  class DataService {
2369
2907
  constructor(dbConnector, collectionName) {
2370
- __publicField$c(this, "collection");
2371
- __publicField$c(this, "state");
2908
+ __publicField$d(this, "collection");
2909
+ __publicField$d(this, "state");
2372
2910
  this.collection = dbConnector.getCollection(collectionName);
2373
2911
  this.state = dbConnector.getCollection("sync");
2374
2912
  }
@@ -2454,16 +2992,16 @@ async function getCurrentBlock() {
2454
2992
  return block_num;
2455
2993
  }
2456
2994
 
2457
- var __defProp$b = Object.defineProperty;
2458
- var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2459
- var __publicField$b = (obj, key, value) => {
2460
- __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
2995
+ var __defProp$c = Object.defineProperty;
2996
+ var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2997
+ var __publicField$c = (obj, key, value) => {
2998
+ __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
2461
2999
  return value;
2462
3000
  };
2463
3001
  class Individual {
2464
3002
  constructor(storage, data) {
2465
- __publicField$b(this, "individual");
2466
- __publicField$b(this, "data_service");
3003
+ __publicField$c(this, "individual");
3004
+ __publicField$c(this, "data_service");
2467
3005
  this.individual = data;
2468
3006
  this.data_service = new DataService$1(storage, "individuals");
2469
3007
  }
@@ -2496,17 +3034,17 @@ class Individual {
2496
3034
  }
2497
3035
  }
2498
3036
 
2499
- var __defProp$a = Object.defineProperty;
2500
- var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2501
- var __publicField$a = (obj, key, value) => {
2502
- __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
3037
+ var __defProp$b = Object.defineProperty;
3038
+ var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3039
+ var __publicField$b = (obj, key, value) => {
3040
+ __defNormalProp$b(obj, typeof key !== "symbol" ? key + "" : key, value);
2503
3041
  return value;
2504
3042
  };
2505
3043
  class Organization {
2506
3044
  constructor(storage, data) {
2507
- __publicField$a(this, "db");
2508
- __publicField$a(this, "organization");
2509
- __publicField$a(this, "data_service");
3045
+ __publicField$b(this, "db");
3046
+ __publicField$b(this, "organization");
3047
+ __publicField$b(this, "data_service");
2510
3048
  this.db = storage;
2511
3049
  this.organization = data;
2512
3050
  this.data_service = new DataService$1(storage, "organizations");
@@ -2552,17 +3090,17 @@ class Organization {
2552
3090
  }
2553
3091
  }
2554
3092
 
2555
- var __defProp$9 = Object.defineProperty;
2556
- var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
2557
- var __publicField$9 = (obj, key, value) => {
2558
- __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
3093
+ var __defProp$a = Object.defineProperty;
3094
+ var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3095
+ var __publicField$a = (obj, key, value) => {
3096
+ __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
2559
3097
  return value;
2560
3098
  };
2561
3099
  class Entrepreneur {
2562
3100
  constructor(storage, data) {
2563
- __publicField$9(this, "db");
2564
- __publicField$9(this, "entrepreneur");
2565
- __publicField$9(this, "data_service");
3101
+ __publicField$a(this, "db");
3102
+ __publicField$a(this, "entrepreneur");
3103
+ __publicField$a(this, "data_service");
2566
3104
  this.db = storage;
2567
3105
  this.entrepreneur = data;
2568
3106
  this.data_service = new DataService$1(storage, "entrepreneurs");
@@ -3011,6 +3549,47 @@ function getEnvVar(key) {
3011
3549
  return envVar;
3012
3550
  }
3013
3551
 
3552
+ var __defProp$9 = Object.defineProperty;
3553
+ var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3554
+ var __publicField$9 = (obj, key, value) => {
3555
+ __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
3556
+ return value;
3557
+ };
3558
+ class PaymentMethod {
3559
+ constructor(storage, data) {
3560
+ __publicField$9(this, "db");
3561
+ __publicField$9(this, "paymentMethod");
3562
+ __publicField$9(this, "data_service");
3563
+ this.db = storage;
3564
+ this.paymentMethod = data;
3565
+ this.data_service = new DataService$1(storage, "paymentMethods");
3566
+ }
3567
+ validate() {
3568
+ return new Validator(paymentMethodSchema, this.paymentMethod).validate();
3569
+ }
3570
+ async save() {
3571
+ await this.validate();
3572
+ if (!this.paymentMethod)
3573
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u043B\u0430\u0442\u0435\u0436\u043D\u043E\u0433\u043E \u043C\u0435\u0442\u043E\u0434\u0430 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u044B \u0434\u043B\u044F \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F");
3574
+ this.paymentMethod.deleted = false;
3575
+ this.paymentMethod.block_num = await getCurrentBlock();
3576
+ return await this.data_service.save(this.paymentMethod);
3577
+ }
3578
+ async getOne(filter) {
3579
+ const result = await this.data_service.getOne(filter);
3580
+ return result;
3581
+ }
3582
+ async getMany(filter) {
3583
+ return this.data_service.getMany({ deleted: false, ...filter }, ["username", "method_id"]);
3584
+ }
3585
+ async getHistory(filter) {
3586
+ return this.data_service.getHistory(filter);
3587
+ }
3588
+ async del(filter) {
3589
+ return this.data_service.updateMany({ ...filter, deleted: false }, { deleted: true });
3590
+ }
3591
+ }
3592
+
3014
3593
  var __defProp$8 = Object.defineProperty;
3015
3594
  var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3016
3595
  var __publicField$8 = (obj, key, value) => {
@@ -3070,12 +3649,25 @@ class Cooperative {
3070
3649
  if (member.position === "chairman")
3071
3650
  chairman = { ...member, ...userData };
3072
3651
  }
3652
+ const paymentMethodModel = new PaymentMethod(this.db);
3653
+ const defaultBankAccountData = await paymentMethodModel.getOne({
3654
+ username,
3655
+ is_default: true,
3656
+ method_type: "bank_transfer",
3657
+ deleted: false,
3658
+ ...block_filter
3659
+ });
3660
+ if (!defaultBankAccountData) {
3661
+ throw new Error("\u0414\u0435\u0444\u043E\u043B\u0442\u043D\u044B\u0439 \u0431\u0430\u043D\u043A\u043E\u0432\u0441\u043A\u0438\u0439 \u0441\u0447\u0435\u0442 \u043A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D \u0432 \u0431\u0430\u0437\u0435 \u0434\u0430\u043D\u043D\u044B\u0445.");
3662
+ }
3663
+ const defaultBankAccount = defaultBankAccountData.data;
3073
3664
  this.cooperative = {
3074
3665
  ...organizationPrivateData,
3075
3666
  ...mappedCooperativeData,
3076
3667
  chairman,
3077
3668
  members,
3078
- totalMembers: members.length
3669
+ totalMembers: members.length,
3670
+ defaultBankAccount
3079
3671
  };
3080
3672
  this.validate();
3081
3673
  return this.cooperative;
@@ -3091,51 +3683,10 @@ var __publicField$7 = (obj, key, value) => {
3091
3683
  __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
3092
3684
  return value;
3093
3685
  };
3094
- class PaymentMethod {
3095
- constructor(storage, data) {
3096
- __publicField$7(this, "db");
3097
- __publicField$7(this, "paymentMethod");
3098
- __publicField$7(this, "data_service");
3099
- this.db = storage;
3100
- this.paymentMethod = data;
3101
- this.data_service = new DataService$1(storage, "paymentMethods");
3102
- }
3103
- validate() {
3104
- return new Validator(paymentMethodSchema, this.paymentMethod).validate();
3105
- }
3106
- async save() {
3107
- await this.validate();
3108
- if (!this.paymentMethod)
3109
- throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u043B\u0430\u0442\u0435\u0436\u043D\u043E\u0433\u043E \u043C\u0435\u0442\u043E\u0434\u0430 \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u044B \u0434\u043B\u044F \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F");
3110
- this.paymentMethod.deleted = false;
3111
- this.paymentMethod.block_num = await getCurrentBlock();
3112
- return await this.data_service.save(this.paymentMethod);
3113
- }
3114
- async getOne(filter) {
3115
- const result = await this.data_service.getOne(filter);
3116
- return result;
3117
- }
3118
- async getMany(filter) {
3119
- return this.data_service.getMany({ deleted: false, ...filter }, ["username", "method_id"]);
3120
- }
3121
- async getHistory(filter) {
3122
- return this.data_service.getHistory(filter);
3123
- }
3124
- async del(filter) {
3125
- return this.data_service.updateMany({ ...filter, deleted: false }, { deleted: true });
3126
- }
3127
- }
3128
-
3129
- var __defProp$6 = Object.defineProperty;
3130
- var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3131
- var __publicField$6 = (obj, key, value) => {
3132
- __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
3133
- return value;
3134
- };
3135
3686
  class Vars {
3136
3687
  constructor(storage, data) {
3137
- __publicField$6(this, "data");
3138
- __publicField$6(this, "data_service");
3688
+ __publicField$7(this, "data");
3689
+ __publicField$7(this, "data_service");
3139
3690
  this.data = data;
3140
3691
  this.data_service = new DataService$1(storage, "vars");
3141
3692
  }
@@ -3163,6 +3714,9 @@ class Vars {
3163
3714
  async getHistory(filter) {
3164
3715
  return this.data_service.getHistory(filter);
3165
3716
  }
3717
+ async update(filter, updateData) {
3718
+ return this.data_service.updateMany(filter, updateData);
3719
+ }
3166
3720
  async del(filter) {
3167
3721
  return this.data_service.updateMany(filter, { deleted: true });
3168
3722
  }
@@ -3172,6 +3726,7 @@ const projectSchema = {
3172
3726
  type: "object",
3173
3727
  properties: {
3174
3728
  id: { type: "string" },
3729
+ title: { type: "string", nullable: true, maxLength: 200 },
3175
3730
  question: { type: "string" },
3176
3731
  decision: { type: "string" },
3177
3732
  block_num: { type: "number", nullable: true },
@@ -3181,16 +3736,16 @@ const projectSchema = {
3181
3736
  additionalProperties: true
3182
3737
  };
3183
3738
 
3184
- var __defProp$5 = Object.defineProperty;
3185
- var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3186
- var __publicField$5 = (obj, key, value) => {
3187
- __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
3739
+ var __defProp$6 = Object.defineProperty;
3740
+ var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3741
+ var __publicField$6 = (obj, key, value) => {
3742
+ __defNormalProp$6(obj, typeof key !== "symbol" ? key + "" : key, value);
3188
3743
  return value;
3189
3744
  };
3190
3745
  class Project {
3191
3746
  constructor(storage, data) {
3192
- __publicField$5(this, "project");
3193
- __publicField$5(this, "data_service");
3747
+ __publicField$6(this, "project");
3748
+ __publicField$6(this, "data_service");
3194
3749
  this.project = data;
3195
3750
  this.data_service = new DataService$1(storage, "projects");
3196
3751
  }
@@ -3223,6 +3778,51 @@ class Project {
3223
3778
  }
3224
3779
  }
3225
3780
 
3781
+ var __defProp$5 = Object.defineProperty;
3782
+ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3783
+ var __publicField$5 = (obj, key, value) => {
3784
+ __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
3785
+ return value;
3786
+ };
3787
+ class Udata {
3788
+ constructor(storage, data) {
3789
+ __publicField$5(this, "udata");
3790
+ __publicField$5(this, "data_service");
3791
+ this.udata = data;
3792
+ this.data_service = new DataService$1(storage, "udatas");
3793
+ }
3794
+ validate() {
3795
+ return new Validator(udataSchema, this.udata).validate();
3796
+ }
3797
+ async save() {
3798
+ await this.validate();
3799
+ if (!this.udata)
3800
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F \u043D\u0435 \u043F\u0440\u0435\u0434\u043E\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u044B \u0434\u043B\u044F \u0441\u043E\u0445\u0440\u0430\u043D\u0435\u043D\u0438\u044F");
3801
+ const currentBlock = await getCurrentBlock();
3802
+ const udata = {
3803
+ ...this.udata,
3804
+ deleted: false,
3805
+ block_num: currentBlock
3806
+ };
3807
+ return await this.data_service.save(udata);
3808
+ }
3809
+ async getOne(filter) {
3810
+ const block_filter = "block_num" in filter && typeof filter.block_num === "number" ? { block_num: { $lte: filter.block_num } } : {};
3811
+ const { block_num, ...filterWithoutBlock } = filter;
3812
+ const finalFilter = { ...filterWithoutBlock, ...block_filter };
3813
+ return this.data_service.getOne(finalFilter);
3814
+ }
3815
+ async getMany(filter) {
3816
+ return this.data_service.getMany(filter, ["coopname", "username", "key"]);
3817
+ }
3818
+ async getHistory(filter) {
3819
+ return this.data_service.getHistory(filter);
3820
+ }
3821
+ async del(filter) {
3822
+ return this.data_service.updateMany(filter, { deleted: true });
3823
+ }
3824
+ }
3825
+
3226
3826
  var __defProp$4 = Object.defineProperty;
3227
3827
  var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3228
3828
  var __publicField$4 = (obj, key, value) => {
@@ -3252,12 +3852,34 @@ class TransExtension {
3252
3852
  class TemplateEngine {
3253
3853
  constructor(translation) {
3254
3854
  __publicField$4(this, "env");
3255
- this.env = new nunjucks.Environment();
3855
+ this.env = new nunjucks.Environment(void 0, { autoescape: false });
3256
3856
  const transExtension = new TransExtension(translation);
3257
3857
  this.env.addExtension("TransExtension", transExtension);
3258
3858
  }
3859
+ // Декодируем HTML-сущности, если до фабрики дошёл экранированный текст (например, <div>)
3860
+ decodeHtml(value) {
3861
+ return value.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&#39;/g, "'");
3862
+ }
3863
+ prepareVars(value) {
3864
+ if (typeof value === "string") {
3865
+ return this.decodeHtml(value);
3866
+ }
3867
+ if (Array.isArray(value)) {
3868
+ return value.map((v) => this.prepareVars(v));
3869
+ }
3870
+ if (value && typeof value === "object") {
3871
+ const result = {};
3872
+ for (const [k, v] of Object.entries(value)) {
3873
+ result[k] = this.prepareVars(v);
3874
+ }
3875
+ return result;
3876
+ }
3877
+ return value;
3878
+ }
3259
3879
  renderTemplate(template, vars) {
3260
- return this.env.renderString(template, vars);
3880
+ const prepared = this.prepareVars(vars);
3881
+ const context = prepared && typeof prepared === "object" ? prepared : {};
3882
+ return this.env.renderString(template, context);
3261
3883
  }
3262
3884
  }
3263
3885
 
@@ -3282,8 +3904,11 @@ class PDFService {
3282
3904
  static async generatePDFBuffer(htmlContent) {
3283
3905
  const tempId = v4();
3284
3906
  const tempDir = path.join(__dirname, "tmp");
3285
- if (!fs.existsSync(tempDir)) {
3286
- fs.mkdirSync(tempDir);
3907
+ try {
3908
+ if (!fs.existsSync(tempDir)) {
3909
+ fs.mkdirSync(tempDir, { recursive: true });
3910
+ }
3911
+ } catch (dirError) {
3287
3912
  }
3288
3913
  const tempHtmlPath = path.join(tempDir, `${tempId}.html`);
3289
3914
  const tempPdfPath = path.join(tempDir, `${tempId}.pdf`);
@@ -3304,12 +3929,24 @@ class PDFService {
3304
3929
  return new Promise((resolve, reject) => {
3305
3930
  exec(`SOURCE_DATE_EPOCH=0 weasyprint ${tempHtmlPath} ${tempPdfPath}`, (error) => {
3306
3931
  if (error) {
3307
- fs.unlinkSync(tempHtmlPath);
3932
+ try {
3933
+ if (fs.existsSync(tempHtmlPath)) {
3934
+ fs.unlinkSync(tempHtmlPath);
3935
+ }
3936
+ } catch (_cleanupError) {
3937
+ }
3308
3938
  reject(error);
3309
3939
  } else {
3310
3940
  const pdfBuffer = fs.readFileSync(tempPdfPath);
3311
- fs.unlinkSync(tempHtmlPath);
3312
- fs.unlinkSync(tempPdfPath);
3941
+ try {
3942
+ if (fs.existsSync(tempHtmlPath)) {
3943
+ fs.unlinkSync(tempHtmlPath);
3944
+ }
3945
+ if (fs.existsSync(tempPdfPath)) {
3946
+ fs.unlinkSync(tempPdfPath);
3947
+ }
3948
+ } catch (_cleanupError) {
3949
+ }
3313
3950
  resolve(new Uint8Array(pdfBuffer));
3314
3951
  }
3315
3952
  });
@@ -3331,7 +3968,7 @@ class PDFService {
3331
3968
 
3332
3969
  const name = "@coopenomics/factory";
3333
3970
  const type = "module";
3334
- const version = "2025.12.2-alpha-3";
3971
+ const version = "2026.2.21-alpha-4";
3335
3972
  const description = "";
3336
3973
  const author = "Alex Ant <chairman.voskhod@gmail.com>";
3337
3974
  const license = "MIT";
@@ -3381,7 +4018,7 @@ const dependencies = {
3381
4018
  "ajv-formats": "^3.0.1",
3382
4019
  "ajv-i18n": "^4.2.0",
3383
4020
  axios: "^1.7.2",
3384
- cooptypes: "2025.12.2-alpha-3",
4021
+ cooptypes: "2026.2.21-alpha-4",
3385
4022
  dotenv: "^16.4.5",
3386
4023
  "eosjs-ecc": "^4.0.7",
3387
4024
  handlebars: "^4.7.8",
@@ -3412,7 +4049,7 @@ const devDependencies = {
3412
4049
  vite: "^5.2.11",
3413
4050
  vitest: "^1.6.0"
3414
4051
  };
3415
- const gitHead = "e27228e735ebec2df66bd808eae15089373f34b5";
4052
+ const gitHead = "4f06bb40f891a2a472fc5e4de124ab4595f32f2f";
3416
4053
  const packageJson = {
3417
4054
  name: name,
3418
4055
  type: type,
@@ -3471,6 +4108,8 @@ function formatDateTime(timestamp) {
3471
4108
  return `${day} ${month} ${year} ${hours}:${minutes} (\u041C\u0441\u043A)`;
3472
4109
  }
3473
4110
 
4111
+ const isEmpty = (value) => !value || value.trim() === "";
4112
+
3474
4113
  var __defProp$3 = Object.defineProperty;
3475
4114
  var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3476
4115
  var __publicField$3 = (obj, key, value) => {
@@ -3630,6 +4269,35 @@ class DocFactory {
3630
4269
  // decision,
3631
4270
  };
3632
4271
  }
4272
+ async getApprovedDecision(coop, coopname, decision_id) {
4273
+ const decision = (await getFetch(`${getEnvVar("SIMPLE_EXPLORER_API")}/get-actions`, new URLSearchParams({
4274
+ filter: JSON.stringify({
4275
+ "account": SovietContract.contractName.production,
4276
+ "name": SovietContract.Actions.Decisions.Authorize.actionName,
4277
+ "receiver": SovietContract.contractName.production,
4278
+ "data.decision_id": String(decision_id),
4279
+ "data.coopname": coopname
4280
+ })
4281
+ })))?.results[0]?.data;
4282
+ if (!decision) {
4283
+ throw new Error(`\u041F\u0440\u0438\u043D\u044F\u0442\u043E\u0435 \u0440\u0435\u0448\u0435\u043D\u0438\u0435 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u0432 \u0434\u0435\u043B\u044C\u0442\u0430\u0445: decision_id=${decision_id}, coopname=${coopname}`);
4284
+ }
4285
+ const authorizationDoc = decision.document;
4286
+ if (!authorizationDoc) {
4287
+ throw new Error(`\u0414\u043E\u043A\u0443\u043C\u0435\u043D\u0442 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D \u0432 \u0440\u0435\u0448\u0435\u043D\u0438\u0438: decision_id=${decision_id}`);
4288
+ }
4289
+ let decisionCreatedAt;
4290
+ try {
4291
+ const meta = JSON.parse(authorizationDoc.meta || "{}");
4292
+ decisionCreatedAt = meta.created_at;
4293
+ if (!decisionCreatedAt) {
4294
+ throw new Error("\u041F\u043E\u043B\u0435 created_at \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E \u0432 \u043C\u0435\u0442\u0430-\u0434\u0430\u043D\u043D\u044B\u0445 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u0438");
4295
+ }
4296
+ } catch (error) {
4297
+ throw new Error(`\u041E\u0448\u0438\u0431\u043A\u0430 \u043F\u0430\u0440\u0441\u0438\u043D\u0433\u0430 \u043C\u0435\u0442\u0430-\u0434\u0430\u043D\u043D\u044B\u0445 \u0430\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0435\u0448\u0435\u043D\u0438\u044F ${decision_id}: ${error}`);
4298
+ }
4299
+ return this.getDecision(coop, coopname, decision_id, decisionCreatedAt);
4300
+ }
3633
4301
  async getMeet(coopname, meet_hash, block_num) {
3634
4302
  const block_filter = block_num ? { block_num: { $lte: block_num } } : {};
3635
4303
  const meetResponse = await getFetch(`${getEnvVar("SIMPLE_EXPLORER_API")}/get-tables`, new URLSearchParams({
@@ -3836,12 +4504,8 @@ class DocFactory {
3836
4504
  year: dateWithTimezone.format("YY")
3837
4505
  };
3838
4506
  }
3839
- constructUHDContract(created_at) {
3840
- const date = created_at ? moment(created_at, "DD.MM.YYYY HH:mm") : moment();
3841
- return {
3842
- number: `\u0423\u0425\u0414-${date.format("DD")}-${date.format("MM")}-${date.format("YY")}`,
3843
- date: date.format("DD.MM.YYYY")
3844
- };
4507
+ constructUHDContractNumber(contributor_hash) {
4508
+ return `\u0423\u0425\u0414-${this.getShortHash(contributor_hash)}`;
3845
4509
  }
3846
4510
  getCommonUser(input) {
3847
4511
  switch (input.type) {
@@ -3851,7 +4515,9 @@ class DocFactory {
3851
4515
  return {
3852
4516
  abbr_full_name: this.extractPersonalAbbreviatedName(data),
3853
4517
  full_name_or_short_name: this.getFullParticipantName(data),
3854
- birthdate_or_ogrn: data.birthdate
4518
+ birthdate_or_ogrn: data.birthdate,
4519
+ email: data.email,
4520
+ phone: data.phone
3855
4521
  };
3856
4522
  }
3857
4523
  case "organization": {
@@ -3859,13 +4525,21 @@ class DocFactory {
3859
4525
  return {
3860
4526
  abbr_full_name: this.extractOrganizationName(data),
3861
4527
  full_name_or_short_name: this.getFullParticipantName(data),
3862
- birthdate_or_ogrn: data.details.ogrn
4528
+ birthdate_or_ogrn: data.details.ogrn,
4529
+ email: data.email,
4530
+ phone: data.phone
3863
4531
  };
3864
4532
  }
3865
4533
  default:
3866
4534
  throw new Error(`cant extract common user data`);
3867
4535
  }
3868
4536
  }
4537
+ getShortHash(hash, length = 16) {
4538
+ if (hash.includes("-") || hash.includes(" ")) {
4539
+ return hash;
4540
+ }
4541
+ return hash.substring(0, length).toUpperCase();
4542
+ }
3869
4543
  async saveDraft(document) {
3870
4544
  await this.storage.saveDraft(document);
3871
4545
  }
@@ -3911,6 +4585,12 @@ class DocFactory {
3911
4585
  ...restParams
3912
4586
  };
3913
4587
  }
4588
+ formatShare(value, precision = 2) {
4589
+ const parsed = typeof value === "string" ? Number.parseFloat(value) : value;
4590
+ if (Number.isNaN(parsed))
4591
+ return typeof value === "string" ? value : value.toString();
4592
+ return parsed.toFixed(precision);
4593
+ }
3914
4594
  formatAsset(asset, precision = 2) {
3915
4595
  if (!asset)
3916
4596
  return "";
@@ -3941,21 +4621,22 @@ class DocFactory {
3941
4621
  }
3942
4622
  }
3943
4623
 
3944
- let Factory$L = class Factory extends DocFactory {
4624
+ let Factory$W = class Factory extends DocFactory {
3945
4625
  constructor(storage) {
3946
4626
  super(storage);
3947
4627
  }
3948
4628
  async generateDocument(data, options) {
3949
4629
  let template;
3950
4630
  if (process.env.SOURCE === "local") {
3951
- template = Template$L;
4631
+ template = Template$W;
3952
4632
  } else {
3953
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$L, data.block_num);
4633
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$W, data.block_num);
3954
4634
  }
3955
4635
  const meta = await super.getMeta({ title: template.title, ...data });
3956
4636
  const coop = await super.getCooperative(data.coopname, data.block_num);
3957
4637
  const vars = await super.getVars(data.coopname, data.block_num);
3958
- const user = await super.getUser(data.username, data.block_num);
4638
+ if (!vars?.wallet_agreement || isEmpty(vars.wallet_agreement.protocol_number) || isEmpty(vars.wallet_agreement.protocol_day_month_year))
4639
+ throw new Error("\u0420\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u0434\u043B\u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u043E \u0426\u041F\u041F \u043D\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u044B. \u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0438\u0445 \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u043A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u0430 \u0438 \u043F\u043E\u0432\u0442\u043E\u0440\u0438\u0442\u0435 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u044E.");
3959
4640
  const combinedData = {
3960
4641
  meta,
3961
4642
  coop,
@@ -3963,26 +4644,27 @@ let Factory$L = class Factory extends DocFactory {
3963
4644
  };
3964
4645
  await super.validate(combinedData, template.model);
3965
4646
  const translation = template.translations[meta.lang];
3966
- const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, options?.skip_save);
4647
+ const document = await super.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
3967
4648
  return document;
3968
4649
  }
3969
4650
  };
3970
4651
 
3971
- let Factory$K = class Factory extends DocFactory {
4652
+ let Factory$V = class Factory extends DocFactory {
3972
4653
  constructor(storage) {
3973
4654
  super(storage);
3974
4655
  }
3975
4656
  async generateDocument(data, options) {
3976
4657
  let template;
3977
4658
  if (process.env.SOURCE === "local") {
3978
- template = Template$K;
4659
+ template = Template$V;
3979
4660
  } else {
3980
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$K, data.block_num);
4661
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$V, data.block_num);
3981
4662
  }
3982
4663
  const meta = await super.getMeta({ title: template.title, ...data });
3983
4664
  const coop = await super.getCooperative(data.coopname, data.block_num);
3984
4665
  const vars = await super.getVars(data.coopname, data.block_num);
3985
- const user = await super.getUser(data.username, data.block_num);
4666
+ if (!vars?.signature_agreement || isEmpty(vars.signature_agreement.protocol_number) || isEmpty(vars.signature_agreement.protocol_day_month_year))
4667
+ throw new Error("\u0420\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u043F\u043E \u043F\u0440\u043E\u0441\u0442\u043E\u0439 \u044D\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0439 \u043F\u043E\u0434\u043F\u0438\u0441\u0438 \u043D\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u044B. \u0414\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0438 \u0434\u0430\u0442\u0443 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u043A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u0430.");
3986
4668
  const combinedData = {
3987
4669
  meta,
3988
4670
  coop,
@@ -3990,26 +4672,27 @@ let Factory$K = class Factory extends DocFactory {
3990
4672
  };
3991
4673
  await super.validate(combinedData, template.model);
3992
4674
  const translation = template.translations[meta.lang];
3993
- const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, options?.skip_save);
4675
+ const document = await super.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
3994
4676
  return document;
3995
4677
  }
3996
4678
  };
3997
4679
 
3998
- let Factory$J = class Factory extends DocFactory {
4680
+ let Factory$U = class Factory extends DocFactory {
3999
4681
  constructor(storage) {
4000
4682
  super(storage);
4001
4683
  }
4002
4684
  async generateDocument(data, options) {
4003
4685
  let template;
4004
4686
  if (process.env.SOURCE === "local") {
4005
- template = Template$J;
4687
+ template = Template$U;
4006
4688
  } else {
4007
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$J, data.block_num);
4689
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$U, data.block_num);
4008
4690
  }
4009
4691
  const meta = await super.getMeta({ title: template.title, ...data });
4010
4692
  const coop = await super.getCooperative(data.coopname, data.block_num);
4011
4693
  const vars = await super.getVars(data.coopname, data.block_num);
4012
- const user = await super.getUser(data.username, data.block_num);
4694
+ if (!vars?.privacy_agreement || isEmpty(vars.privacy_agreement.protocol_number) || isEmpty(vars.privacy_agreement.protocol_day_month_year))
4695
+ throw new Error("\u0420\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u043F\u043E \u043F\u043E\u043B\u0438\u0442\u0438\u043A\u0435 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438 \u043D\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u044B. \u0414\u043E\u0431\u0430\u0432\u044C\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0438 \u0434\u0430\u0442\u0443 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u043A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u0430.");
4013
4696
  const combinedData = {
4014
4697
  meta,
4015
4698
  coop,
@@ -4017,27 +4700,29 @@ let Factory$J = class Factory extends DocFactory {
4017
4700
  };
4018
4701
  await super.validate(combinedData, template.model);
4019
4702
  const translation = template.translations[meta.lang];
4020
- const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, options?.skip_save);
4703
+ const document = await super.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
4021
4704
  return document;
4022
4705
  }
4023
4706
  };
4024
4707
 
4025
- let Factory$I = class Factory extends DocFactory {
4708
+ let Factory$T = class Factory extends DocFactory {
4026
4709
  constructor(storage) {
4027
4710
  super(storage);
4028
4711
  }
4029
4712
  async generateDocument(data, options) {
4030
4713
  let template;
4031
4714
  if (process.env.SOURCE === "local") {
4032
- template = Template$I;
4715
+ template = Template$T;
4033
4716
  } else {
4034
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$I, data.block_num);
4717
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$T, data.block_num);
4035
4718
  }
4036
4719
  const meta = await super.getMeta({ title: template.title, ...data });
4037
4720
  const coop = await super.getCooperative(data.coopname, data.block_num);
4038
4721
  const vars = await super.getVars(data.coopname, data.block_num);
4039
4722
  const user = await super.getUser(data.username, data.block_num);
4040
4723
  const full_name = super.getFullName(user.data);
4724
+ if (!vars?.user_agreement || isEmpty(vars.user_agreement.protocol_number) || isEmpty(vars.user_agreement.protocol_day_month_year))
4725
+ throw new Error("\u0420\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u043F\u043E \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C\u0441\u043A\u043E\u043C\u0443 \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044E \u043D\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u044B. \u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0438 \u0434\u0430\u0442\u0443 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u043A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u0430.");
4041
4726
  const combinedData = {
4042
4727
  meta,
4043
4728
  coop,
@@ -4048,27 +4733,26 @@ let Factory$I = class Factory extends DocFactory {
4048
4733
  };
4049
4734
  await super.validate(combinedData, template.model);
4050
4735
  const translation = template.translations[meta.lang];
4051
- const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, options?.skip_save);
4736
+ const document = await super.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
4052
4737
  return document;
4053
4738
  }
4054
4739
  };
4055
4740
 
4056
- let Factory$H = class Factory extends DocFactory {
4741
+ let Factory$S = class Factory extends DocFactory {
4057
4742
  constructor(storage) {
4058
4743
  super(storage);
4059
4744
  }
4060
4745
  async generateDocument(data, options) {
4061
4746
  let template;
4062
4747
  if (process.env.SOURCE === "local") {
4063
- template = Template$H;
4748
+ template = Template$S;
4064
4749
  } else {
4065
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$H, data.block_num);
4750
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$S, data.block_num);
4066
4751
  }
4067
4752
  const meta = await super.getMeta({ title: template.title, ...data });
4068
4753
  const coop = await super.getCooperative(data.coopname, data.block_num);
4069
4754
  const vars = await super.getVars(data.coopname, data.block_num);
4070
4755
  const partner = await super.getOrganization(data.username, data.block_num);
4071
- const user = await super.getUser(data.username, data.block_num);
4072
4756
  const combinedData = {
4073
4757
  meta,
4074
4758
  coop,
@@ -4077,21 +4761,21 @@ let Factory$H = class Factory extends DocFactory {
4077
4761
  };
4078
4762
  await super.validate(combinedData, template.model);
4079
4763
  const translation = template.translations[meta.lang];
4080
- const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, options?.skip_save);
4764
+ const document = await super.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
4081
4765
  return document;
4082
4766
  }
4083
4767
  };
4084
4768
 
4085
- let Factory$G = class Factory extends DocFactory {
4769
+ let Factory$R = class Factory extends DocFactory {
4086
4770
  constructor(storage) {
4087
4771
  super(storage);
4088
4772
  }
4089
4773
  async generateDocument(data, options) {
4090
4774
  let template;
4091
4775
  if (process.env.SOURCE === "local") {
4092
- template = Template$G;
4776
+ template = Template$R;
4093
4777
  } else {
4094
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$G, data.block_num);
4778
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$R, data.block_num);
4095
4779
  }
4096
4780
  const meta = await super.getMeta({ title: template.title, ...data });
4097
4781
  const coop = await super.getCooperative(data.coopname, data.block_num);
@@ -4106,21 +4790,21 @@ let Factory$G = class Factory extends DocFactory {
4106
4790
  };
4107
4791
  await super.validate(combinedData, template.model);
4108
4792
  const translation = template.translations[meta.lang];
4109
- const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, options?.skip_save);
4793
+ const document = await super.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
4110
4794
  return document;
4111
4795
  }
4112
4796
  };
4113
4797
 
4114
- let Factory$F = class Factory extends DocFactory {
4798
+ let Factory$Q = class Factory extends DocFactory {
4115
4799
  constructor(storage) {
4116
4800
  super(storage);
4117
4801
  }
4118
4802
  async generateDocument(data, _options) {
4119
4803
  let template;
4120
4804
  if (process.env.SOURCE === "local") {
4121
- template = Template$D;
4805
+ template = Template$O;
4122
4806
  } else {
4123
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$D, data.block_num);
4807
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$O, data.block_num);
4124
4808
  }
4125
4809
  const user = await super.getUser(data.username, data.block_num);
4126
4810
  const userData = {
@@ -4134,24 +4818,26 @@ let Factory$F = class Factory extends DocFactory {
4134
4818
  const branch = await super.getOrganization(data.braname, data.block_num);
4135
4819
  const meta = await super.getMeta({ title: template.title, ...data });
4136
4820
  const vars = await super.getVars(data.coopname, data.block_num);
4821
+ if (!vars?.participant_application || isEmpty(vars.participant_application.protocol_number) || isEmpty(vars.participant_application.protocol_day_month_year))
4822
+ throw new Error("\u0420\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u0434\u043B\u044F \u0437\u0430\u044F\u0432\u043B\u0435\u043D\u0438\u044F \u043D\u0430 \u0432\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u0435 \u043D\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u044B. \u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0438 \u0434\u0430\u0442\u0443 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u043A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u0430.");
4137
4823
  const combinedData = { ...userData, meta, branch, type: user.type, vars, coop };
4138
4824
  await super.validate(combinedData, template.model);
4139
4825
  const translation = template.translations[meta.lang];
4140
- const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, data.skip_save);
4826
+ const document = await super.generatePDF("", template.context, combinedData, translation, meta, data.skip_save);
4141
4827
  return document;
4142
4828
  }
4143
4829
  };
4144
4830
 
4145
- let Factory$E = class Factory extends DocFactory {
4831
+ let Factory$P = class Factory extends DocFactory {
4146
4832
  constructor(storage) {
4147
4833
  super(storage);
4148
4834
  }
4149
4835
  async generateDocument(data, _options) {
4150
4836
  let template;
4151
4837
  if (process.env.SOURCE === "local") {
4152
- template = Template$F;
4838
+ template = Template$Q;
4153
4839
  } else {
4154
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$F, data.block_num);
4840
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$Q, data.block_num);
4155
4841
  }
4156
4842
  const user = await super.getUser(data.username, data.block_num);
4157
4843
  let bank_account = {};
@@ -4192,6 +4878,8 @@ let Factory$E = class Factory extends DocFactory {
4192
4878
  }
4193
4879
  }
4194
4880
  const vars = await super.getVars(data.coopname, data.block_num);
4881
+ if (!vars?.participant_application || isEmpty(vars.participant_application.protocol_number) || isEmpty(vars.participant_application.protocol_day_month_year))
4882
+ throw new Error("\u0420\u0435\u043A\u0432\u0438\u0437\u0438\u0442\u044B \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u0434\u043B\u044F \u0437\u0430\u044F\u0432\u043B\u0435\u043D\u0438\u044F \u043D\u0430 \u0432\u0441\u0442\u0443\u043F\u043B\u0435\u043D\u0438\u0435 \u043D\u0435 \u0437\u0430\u043F\u043E\u043B\u043D\u0435\u043D\u044B. \u0417\u0430\u043F\u043E\u043B\u043D\u0438\u0442\u0435 \u043D\u043E\u043C\u0435\u0440 \u0438 \u0434\u0430\u0442\u0443 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u0432 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0430\u0445 \u043A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u0430.");
4195
4883
  const combinedData = {
4196
4884
  ...userData,
4197
4885
  meta,
@@ -4207,21 +4895,21 @@ let Factory$E = class Factory extends DocFactory {
4207
4895
  };
4208
4896
  await super.validate(combinedData, template.model);
4209
4897
  const translation = template.translations[meta.lang];
4210
- const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, data.skip_save);
4898
+ const document = await super.generatePDF("", template.context, combinedData, translation, meta, data.skip_save);
4211
4899
  return document;
4212
4900
  }
4213
4901
  };
4214
4902
 
4215
- let Factory$D = class Factory extends DocFactory {
4903
+ let Factory$O = class Factory extends DocFactory {
4216
4904
  constructor(storage) {
4217
4905
  super(storage);
4218
4906
  }
4219
4907
  async generateDocument(data, options) {
4220
4908
  let template;
4221
4909
  if (process.env.SOURCE === "local") {
4222
- template = Template$E;
4910
+ template = Template$P;
4223
4911
  } else {
4224
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$E, data.block_num);
4912
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$P, data.block_num);
4225
4913
  }
4226
4914
  const user = await super.getUser(data.username, data.block_num);
4227
4915
  const userData = {
@@ -4261,16 +4949,16 @@ let Factory$D = class Factory extends DocFactory {
4261
4949
  }
4262
4950
  };
4263
4951
 
4264
- let Factory$C = class Factory extends DocFactory {
4952
+ let Factory$N = class Factory extends DocFactory {
4265
4953
  constructor(storage) {
4266
4954
  super(storage);
4267
4955
  }
4268
4956
  async generateDocument(data, options) {
4269
4957
  let template;
4270
4958
  if (process.env.SOURCE === "local") {
4271
- template = Template$C;
4959
+ template = Template$N;
4272
4960
  } else {
4273
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$C, data.block_num);
4961
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$N, data.block_num);
4274
4962
  }
4275
4963
  const user = await this.getUser(data.username, data.block_num);
4276
4964
  const suggester_name = await this.getFullName(user.data);
@@ -4278,11 +4966,12 @@ let Factory$C = class Factory extends DocFactory {
4278
4966
  [user.type]: user.data
4279
4967
  };
4280
4968
  const coop = await this.getCooperative(data.coopname, data.block_num);
4969
+ const project = await this.getProject(data.project_id, data.block_num);
4970
+ const metaTitle = data.title?.trim()?.substring(0, 200) || project.title?.trim()?.substring(0, 200) || template.title;
4281
4971
  const meta = await this.getMeta({
4282
- title: template.title,
4283
- ...data
4972
+ ...data,
4973
+ title: metaTitle
4284
4974
  });
4285
- const project = await this.getProject(data.project_id, data.block_num);
4286
4975
  const vars = await super.getVars(data.coopname, data.block_num);
4287
4976
  const combinedData = {
4288
4977
  ...userData,
@@ -4306,16 +4995,16 @@ let Factory$C = class Factory extends DocFactory {
4306
4995
  }
4307
4996
  };
4308
4997
 
4309
- let Factory$B = class Factory extends DocFactory {
4998
+ let Factory$M = class Factory extends DocFactory {
4310
4999
  constructor(storage) {
4311
5000
  super(storage);
4312
5001
  }
4313
5002
  async generateDocument(data, options) {
4314
5003
  let template;
4315
5004
  if (process.env.SOURCE === "local") {
4316
- template = Template$B;
5005
+ template = Template$M;
4317
5006
  } else {
4318
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$B, data.block_num);
5007
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$M, data.block_num);
4319
5008
  }
4320
5009
  const user = await this.getUser(data.username, data.block_num);
4321
5010
  const userData = {
@@ -4358,16 +5047,16 @@ let Factory$B = class Factory extends DocFactory {
4358
5047
  }
4359
5048
  };
4360
5049
 
4361
- let Factory$A = class Factory extends DocFactory {
5050
+ let Factory$L = class Factory extends DocFactory {
4362
5051
  constructor(storage) {
4363
5052
  super(storage);
4364
5053
  }
4365
5054
  async generateDocument(data, options) {
4366
5055
  let template;
4367
5056
  if (process.env.SOURCE === "local") {
4368
- template = Template$A;
5057
+ template = Template$L;
4369
5058
  } else {
4370
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$A, data.block_num);
5059
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$L, data.block_num);
4371
5060
  }
4372
5061
  const meta = await super.getMeta({ title: template.title, ...data });
4373
5062
  const coop = await super.getCooperative(data.coopname, data.block_num);
@@ -4389,16 +5078,16 @@ let Factory$A = class Factory extends DocFactory {
4389
5078
  }
4390
5079
  };
4391
5080
 
4392
- let Factory$z = class Factory extends DocFactory {
5081
+ let Factory$K = class Factory extends DocFactory {
4393
5082
  constructor(storage) {
4394
5083
  super(storage);
4395
5084
  }
4396
5085
  async generateDocument(data, options) {
4397
5086
  let template;
4398
5087
  if (process.env.SOURCE === "local") {
4399
- template = Template$z;
5088
+ template = Template$K;
4400
5089
  } else {
4401
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$z, data.block_num);
5090
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$K, data.block_num);
4402
5091
  }
4403
5092
  const meta = await this.getMeta({ title: template.title, ...data });
4404
5093
  const coop = await this.getCooperative(data.coopname, data.block_num);
@@ -4420,7 +5109,7 @@ let Factory$z = class Factory extends DocFactory {
4420
5109
  }
4421
5110
  };
4422
5111
 
4423
- let Factory$y = class Factory extends DocFactory {
5112
+ let Factory$J = class Factory extends DocFactory {
4424
5113
  constructor(storage) {
4425
5114
  super(storage);
4426
5115
  }
@@ -4434,7 +5123,7 @@ let Factory$y = class Factory extends DocFactory {
4434
5123
  const meta = await super.getMeta({ title: template.title, ...data });
4435
5124
  const coop = await super.getCooperative(data.coopname, data.block_num);
4436
5125
  const vars = await super.getVars(data.coopname, data.block_num);
4437
- const user = await super.getUser(data.username, data.block_num);
5126
+ await super.getUser(data.username, data.block_num);
4438
5127
  const combinedData = {
4439
5128
  meta,
4440
5129
  coop,
@@ -4442,21 +5131,21 @@ let Factory$y = class Factory extends DocFactory {
4442
5131
  };
4443
5132
  await super.validate(combinedData, template.model);
4444
5133
  const translation = template.translations[meta.lang];
4445
- const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, options?.skip_save);
5134
+ const document = await super.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
4446
5135
  return document;
4447
5136
  }
4448
5137
  };
4449
5138
 
4450
- let Factory$x = class Factory extends DocFactory {
5139
+ let Factory$I = class Factory extends DocFactory {
4451
5140
  constructor(storage) {
4452
5141
  super(storage);
4453
5142
  }
4454
5143
  async generateDocument(data, options) {
4455
5144
  let template;
4456
5145
  if (process.env.SOURCE === "local") {
4457
- template = Template$y;
5146
+ template = Template$J;
4458
5147
  } else {
4459
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$y, data.block_num);
5148
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$J, data.block_num);
4460
5149
  }
4461
5150
  const meta = await this.getMeta({ title: template.title, ...data });
4462
5151
  const coop = await this.getCooperative(data.coopname, data.block_num);
@@ -4480,23 +5169,23 @@ let Factory$x = class Factory extends DocFactory {
4480
5169
  }
4481
5170
  };
4482
5171
 
4483
- let Factory$w = class Factory extends DocFactory {
5172
+ let Factory$H = class Factory extends DocFactory {
4484
5173
  constructor(storage) {
4485
5174
  super(storage);
4486
5175
  }
4487
5176
  async generateDocument(data, options) {
4488
5177
  let template;
4489
5178
  if (process.env.SOURCE === "local") {
4490
- template = Template$w;
5179
+ template = Template$H;
4491
5180
  } else {
4492
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$w, data.block_num);
5181
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$H, data.block_num);
4493
5182
  }
4494
5183
  const meta = await this.getMeta({ title: template.title, ...data });
4495
5184
  const coop = await this.getCooperative(data.coopname, data.block_num);
4496
5185
  const vars = await this.getVars(data.coopname, data.block_num);
4497
5186
  const user = await this.getUser(data.username, data.block_num);
4498
5187
  const request = await this.getRequest(data.request_id, data.block_num);
4499
- const decision = await this.getDecision(coop, data.coopname, data.decision_id, meta.created_at);
5188
+ const decision = await this.getApprovedDecision(coop, data.coopname, data.decision_id);
4500
5189
  const commonUser = this.getCommonUser(user);
4501
5190
  const receiver = await this.getUser(data.receiver, data.block_num);
4502
5191
  if (coop.is_branched && !data.braname)
@@ -4524,16 +5213,16 @@ let Factory$w = class Factory extends DocFactory {
4524
5213
  }
4525
5214
  };
4526
5215
 
4527
- let Factory$v = class Factory extends DocFactory {
5216
+ let Factory$G = class Factory extends DocFactory {
4528
5217
  constructor(storage) {
4529
5218
  super(storage);
4530
5219
  }
4531
5220
  async generateDocument(data, options) {
4532
5221
  let template;
4533
5222
  if (process.env.SOURCE === "local") {
4534
- template = Template$x;
5223
+ template = Template$I;
4535
5224
  } else {
4536
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$x, data.block_num);
5225
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$I, data.block_num);
4537
5226
  }
4538
5227
  const meta = await this.getMeta({ title: template.title, ...data });
4539
5228
  const coop = await this.getCooperative(data.coopname, data.block_num);
@@ -4557,23 +5246,23 @@ let Factory$v = class Factory extends DocFactory {
4557
5246
  }
4558
5247
  };
4559
5248
 
4560
- let Factory$u = class Factory extends DocFactory {
5249
+ let Factory$F = class Factory extends DocFactory {
4561
5250
  constructor(storage) {
4562
5251
  super(storage);
4563
5252
  }
4564
5253
  async generateDocument(data, options) {
4565
5254
  let template;
4566
5255
  if (process.env.SOURCE === "local") {
4567
- template = Template$v;
5256
+ template = Template$G;
4568
5257
  } else {
4569
- template = await this.getTemplate(DraftContract.contractName.production, registry_id$v, data.block_num);
5258
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$G, data.block_num);
4570
5259
  }
4571
5260
  const meta = await this.getMeta({ title: template.title, ...data });
4572
5261
  const coop = await this.getCooperative(data.coopname, data.block_num);
4573
5262
  const vars = await this.getVars(data.coopname, data.block_num);
4574
5263
  const user = await this.getUser(data.username, data.block_num);
4575
5264
  const request = await this.getRequest(data.request_id, data.block_num);
4576
- const decision = await this.getDecision(coop, data.coopname, data.decision_id, meta.created_at);
5265
+ const decision = await this.getApprovedDecision(coop, data.coopname, data.decision_id);
4577
5266
  const commonUser = this.getCommonUser(user);
4578
5267
  const transmitter = await this.getUser(data.transmitter, data.block_num);
4579
5268
  if (coop.is_branched && !data.braname)
@@ -4586,22 +5275,287 @@ let Factory$u = class Factory extends DocFactory {
4586
5275
  meta,
4587
5276
  coop,
4588
5277
  vars,
4589
- user: commonUser,
4590
- request,
4591
- decision,
4592
- program,
4593
- act_id: data.act_id,
4594
- transmitter: this.getFirstLastMiddleName(transmitter.data),
4595
- branch
5278
+ user: commonUser,
5279
+ request,
5280
+ decision,
5281
+ program,
5282
+ act_id: data.act_id,
5283
+ transmitter: this.getFirstLastMiddleName(transmitter.data),
5284
+ branch
5285
+ };
5286
+ await this.validate(combinedData, template.model);
5287
+ const translation = template.translations[meta.lang];
5288
+ const document = await this.generatePDF(commonUser.full_name_or_short_name, template.context, combinedData, translation, meta, options?.skip_save);
5289
+ return document;
5290
+ }
5291
+ };
5292
+
5293
+ let Factory$E = class Factory extends DocFactory {
5294
+ constructor(storage) {
5295
+ super(storage);
5296
+ }
5297
+ async generateDocument(data, options) {
5298
+ let template;
5299
+ if (process.env.SOURCE === "local") {
5300
+ template = Template$F;
5301
+ } else {
5302
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$F, data.block_num);
5303
+ }
5304
+ console.log(data);
5305
+ const meta = await this.getMeta({ title: template.title, ...data });
5306
+ const coop = await this.getCooperative(data.coopname, data.block_num);
5307
+ const vars = await this.getVars(data.coopname, data.block_num);
5308
+ const user = await this.getUser(data.username, data.block_num);
5309
+ const commonUser = this.getCommonUser(user);
5310
+ const paymentMethodService = new PaymentMethod(this.storage);
5311
+ const paymentMethod = await paymentMethodService.getOne({
5312
+ method_id: data.method_id,
5313
+ username: data.username,
5314
+ deleted: false
5315
+ });
5316
+ if (!paymentMethod) {
5317
+ throw new Error(`\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u044B\u0439 \u043C\u0435\u0442\u043E\u0434 \u0441 ID ${data.method_id} \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D \u0434\u043B\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F ${data.username}`);
5318
+ }
5319
+ const combinedData = {
5320
+ meta,
5321
+ coop,
5322
+ vars,
5323
+ user: commonUser,
5324
+ payment_details: this.formatPaymentDetails(paymentMethod, commonUser.full_name_or_short_name),
5325
+ quantity: data.quantity,
5326
+ currency: data.currency,
5327
+ payment_hash: data.payment_hash
5328
+ };
5329
+ await this.validate(combinedData, template.model);
5330
+ const translation = template.translations[meta.lang];
5331
+ const document = await this.generatePDF(commonUser.full_name_or_short_name, template.context, combinedData, translation, meta, options?.skip_save);
5332
+ return document;
5333
+ }
5334
+ };
5335
+
5336
+ let Factory$D = class Factory extends DocFactory {
5337
+ constructor(storage) {
5338
+ super(storage);
5339
+ }
5340
+ async generateDocument(data, options) {
5341
+ let template;
5342
+ if (process.env.SOURCE === "local") {
5343
+ template = Template$E;
5344
+ } else {
5345
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$E, data.block_num);
5346
+ }
5347
+ const user = await super.getUser(data.username, data.block_num);
5348
+ const coop = await super.getCooperative(data.coopname, data.block_num);
5349
+ const vars = await super.getVars(data.coopname, data.block_num);
5350
+ const meta = await super.getMeta({
5351
+ title: template.title,
5352
+ ...data
5353
+ });
5354
+ const decision = await super.getDecision(
5355
+ coop,
5356
+ data.coopname,
5357
+ data.decision_id,
5358
+ meta.created_at
5359
+ );
5360
+ const combinedData = {
5361
+ vars,
5362
+ meta,
5363
+ coop,
5364
+ decision,
5365
+ user: super.getCommonUser(user),
5366
+ quantity: data.quantity,
5367
+ currency: data.currency
5368
+ };
5369
+ await super.validate(combinedData, template.model);
5370
+ const translation = template.translations[meta.lang];
5371
+ const document = await super.generatePDF(
5372
+ user.data,
5373
+ template.context,
5374
+ combinedData,
5375
+ translation,
5376
+ meta,
5377
+ options?.skip_save
5378
+ );
5379
+ return document;
5380
+ }
5381
+ };
5382
+
5383
+ let Factory$C = class Factory extends DocFactory {
5384
+ constructor(storage) {
5385
+ super(storage);
5386
+ }
5387
+ async generateDocument(data, options) {
5388
+ let template;
5389
+ if (process.env.SOURCE === "local") {
5390
+ template = Template$x;
5391
+ } else {
5392
+ template = await this.getTemplate(DraftContract.contractName.production, 1e3, data.block_num);
5393
+ }
5394
+ const meta = await this.getMeta({ title: template.title, ...data });
5395
+ const vars = await this.getVars(data.coopname);
5396
+ const coop = await this.getCooperative(data.coopname);
5397
+ const userData = await this.getUser(data.username, data.block_num);
5398
+ const common_user = this.getCommonUser(userData);
5399
+ if (!vars.blagorost_program?.protocol_number || !vars.blagorost_program?.protocol_day_month_year) {
5400
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u043E\u0431 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0438 \u041F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043E \u0426\u041F\u041F \xAB\u0411\u041B\u0410\u0413\u041E\u0420\u041E\u0421\u0422\xBB \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B. \u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u041F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430.");
5401
+ }
5402
+ if (!vars.blagorost_offer_template?.protocol_number || !vars.blagorost_offer_template?.protocol_day_month_year) {
5403
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u043E\u0431 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0430 \u043F\u0443\u0431\u043B\u0438\u0447\u043D\u043E\u0439 \u043E\u0444\u0435\u0440\u0442\u044B \u0426\u041F\u041F \xAB\u0411\u041B\u0410\u0413\u041E\u0420\u041E\u0421\u0422\xBB \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B. \u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0448\u0430\u0431\u043B\u043E\u043D \u043E\u0444\u0435\u0440\u0442\u044B \u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430.");
5404
+ }
5405
+ const udataService = new Udata(this.storage);
5406
+ const blagorostAgreementUdata = await udataService.getOne({
5407
+ coopname: data.coopname,
5408
+ username: data.username,
5409
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_NUMBER,
5410
+ block_num: data.block_num
5411
+ });
5412
+ if (!blagorostAgreementUdata?.value) {
5413
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u0431\u043B\u0430\u0433\u043E\u0440\u043E\u0441\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
5414
+ }
5415
+ const blagorostAgreementCreatedAtUdata = await udataService.getOne({
5416
+ coopname: data.coopname,
5417
+ username: data.username,
5418
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_CREATED_AT,
5419
+ block_num: data.block_num
5420
+ });
5421
+ if (!blagorostAgreementCreatedAtUdata?.value) {
5422
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u0431\u043B\u0430\u0433\u043E\u0440\u043E\u0441\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
5423
+ }
5424
+ const combinedData = {
5425
+ meta,
5426
+ coop,
5427
+ vars,
5428
+ common_user,
5429
+ blagorost_agreement_number: String(blagorostAgreementUdata.value),
5430
+ blagorost_agreement_created_at: String(blagorostAgreementCreatedAtUdata.value)
5431
+ };
5432
+ await this.validate(combinedData, template.model);
5433
+ const translation = template.translations[meta.lang];
5434
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
5435
+ return document;
5436
+ }
5437
+ };
5438
+
5439
+ let Factory$B = class Factory extends DocFactory {
5440
+ constructor(storage) {
5441
+ super(storage);
5442
+ }
5443
+ async generateDocument(data, options) {
5444
+ let template;
5445
+ if (process.env.SOURCE === "local") {
5446
+ template = Template$w;
5447
+ } else {
5448
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$w, data.block_num);
5449
+ }
5450
+ const meta = await this.getMeta({ title: template.title, ...data });
5451
+ const coop = await super.getCooperative(data.coopname, data.block_num);
5452
+ const vars = await super.getVars(data.coopname, data.block_num);
5453
+ if (!vars.generation_contract_template?.protocol_number || !vars.generation_contract_template?.protocol_day_month_year) {
5454
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u043E\u0431 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0438 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B. \u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0435 \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u0435 \u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430.");
5455
+ }
5456
+ const userData = await super.getUser(data.username, data.block_num);
5457
+ const user = super.getCommonUser(userData);
5458
+ const udataService = new Udata(this.storage);
5459
+ const contributorContractUdata = await udataService.getOne({
5460
+ coopname: data.coopname,
5461
+ username: data.username,
5462
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
5463
+ block_num: data.block_num
5464
+ });
5465
+ if (!contributorContractUdata?.value) {
5466
+ throw new Error(
5467
+ `\u0414\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata \u0434\u043B\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F ${data.username}. \u041D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u0441\u0433\u0435\u043D\u0435\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 UdataDocumentParametersService.`
5468
+ );
5469
+ }
5470
+ const combinedData = {
5471
+ meta,
5472
+ coop,
5473
+ vars,
5474
+ user,
5475
+ contributor_contract_number: String(contributorContractUdata.value)
5476
+ };
5477
+ await this.validate(combinedData, template.model);
5478
+ const translation = template.translations[meta.lang];
5479
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
5480
+ return document;
5481
+ }
5482
+ };
5483
+
5484
+ let Factory$A = class Factory extends DocFactory {
5485
+ constructor(storage) {
5486
+ super(storage);
5487
+ }
5488
+ async generateDocument(data, options) {
5489
+ let template;
5490
+ if (process.env.SOURCE === "local") {
5491
+ template = Template$v;
5492
+ } else {
5493
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$v, data.block_num);
5494
+ }
5495
+ const meta = await this.getMeta({ title: template.title, ...data });
5496
+ const coop = await super.getCooperative(data.coopname, data.block_num);
5497
+ const vars = await super.getVars(data.coopname, data.block_num);
5498
+ const userData = await super.getUser(data.username, data.block_num);
5499
+ const user = super.getCommonUser(userData);
5500
+ const udataService = new Udata(this.storage);
5501
+ const generatorAgreementUdata = await udataService.getOne({
5502
+ coopname: data.coopname,
5503
+ username: data.username,
5504
+ key: Cooperative$1.Model.UdataKey.GENERATOR_AGREEMENT_NUMBER,
5505
+ block_num: data.block_num
5506
+ });
5507
+ if (!generatorAgreementUdata?.value) {
5508
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
5509
+ }
5510
+ const generatorAgreementCreatedAtUdata = await udataService.getOne({
5511
+ coopname: data.coopname,
5512
+ username: data.username,
5513
+ key: Cooperative$1.Model.UdataKey.GENERATOR_AGREEMENT_CREATED_AT,
5514
+ block_num: data.block_num
5515
+ });
5516
+ if (!generatorAgreementCreatedAtUdata?.value) {
5517
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
5518
+ }
5519
+ const contributorContractUdata = await udataService.getOne({
5520
+ coopname: data.coopname,
5521
+ username: data.username,
5522
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
5523
+ block_num: data.block_num
5524
+ });
5525
+ if (!contributorContractUdata?.value) {
5526
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
5527
+ }
5528
+ const contributorContractCreatedAtUdata = await udataService.getOne({
5529
+ coopname: data.coopname,
5530
+ username: data.username,
5531
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT,
5532
+ block_num: data.block_num
5533
+ });
5534
+ if (!contributorContractCreatedAtUdata?.value) {
5535
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
5536
+ }
5537
+ const combinedData = {
5538
+ meta,
5539
+ coop,
5540
+ vars,
5541
+ user,
5542
+ appendix_hash: data.appendix_hash,
5543
+ short_appendix_hash: this.getShortHash(data.appendix_hash),
5544
+ contributor_contract_number: String(contributorContractUdata.value),
5545
+ contributor_contract_created_at: String(contributorContractCreatedAtUdata.value),
5546
+ project_name: data.project_name,
5547
+ project_hash: data.project_hash,
5548
+ generator_agreement_number: String(generatorAgreementUdata.value),
5549
+ generator_agreement_created_at: String(generatorAgreementCreatedAtUdata.value)
4596
5550
  };
4597
5551
  await this.validate(combinedData, template.model);
4598
5552
  const translation = template.translations[meta.lang];
4599
- const document = await this.generatePDF(commonUser.full_name_or_short_name, template.context, combinedData, translation, meta, options?.skip_save);
5553
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
4600
5554
  return document;
4601
5555
  }
4602
5556
  };
4603
5557
 
4604
- let Factory$t = class Factory extends DocFactory {
5558
+ let Factory$z = class Factory extends DocFactory {
4605
5559
  constructor(storage) {
4606
5560
  super(storage);
4607
5561
  }
@@ -4612,39 +5566,72 @@ let Factory$t = class Factory extends DocFactory {
4612
5566
  } else {
4613
5567
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$u, data.block_num);
4614
5568
  }
4615
- console.log(data);
4616
5569
  const meta = await this.getMeta({ title: template.title, ...data });
4617
- const coop = await this.getCooperative(data.coopname, data.block_num);
4618
- const vars = await this.getVars(data.coopname, data.block_num);
4619
- const user = await this.getUser(data.username, data.block_num);
4620
- const commonUser = this.getCommonUser(user);
4621
- const paymentMethodService = new PaymentMethod(this.storage);
4622
- const paymentMethod = await paymentMethodService.getOne({
4623
- method_id: data.method_id,
5570
+ const coop = await super.getCooperative(data.coopname, data.block_num);
5571
+ const vars = await super.getVars(data.coopname, data.block_num);
5572
+ const userData = await super.getUser(data.username, data.block_num);
5573
+ const user = super.getCommonUser(userData);
5574
+ const udataService = new Udata(this.storage);
5575
+ const generatorAgreementUdata = await udataService.getOne({
5576
+ coopname: data.coopname,
4624
5577
  username: data.username,
4625
- deleted: false
5578
+ key: Cooperative$1.Model.UdataKey.GENERATOR_AGREEMENT_NUMBER,
5579
+ block_num: data.block_num
4626
5580
  });
4627
- if (!paymentMethod) {
4628
- throw new Error(`\u041F\u043B\u0430\u0442\u0435\u0436\u043D\u044B\u0439 \u043C\u0435\u0442\u043E\u0434 \u0441 ID ${data.method_id} \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D \u0434\u043B\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F ${data.username}`);
5581
+ if (!generatorAgreementUdata?.value) {
5582
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
5583
+ }
5584
+ const generatorAgreementCreatedAtUdata = await udataService.getOne({
5585
+ coopname: data.coopname,
5586
+ username: data.username,
5587
+ key: Cooperative$1.Model.UdataKey.GENERATOR_AGREEMENT_CREATED_AT,
5588
+ block_num: data.block_num
5589
+ });
5590
+ if (!generatorAgreementCreatedAtUdata?.value) {
5591
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
5592
+ }
5593
+ const contributorContractUdata = await udataService.getOne({
5594
+ coopname: data.coopname,
5595
+ username: data.username,
5596
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
5597
+ block_num: data.block_num
5598
+ });
5599
+ if (!contributorContractUdata?.value) {
5600
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
5601
+ }
5602
+ const contributorContractCreatedAtUdata = await udataService.getOne({
5603
+ coopname: data.coopname,
5604
+ username: data.username,
5605
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT,
5606
+ block_num: data.block_num
5607
+ });
5608
+ if (!contributorContractCreatedAtUdata?.value) {
5609
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
4629
5610
  }
4630
5611
  const combinedData = {
4631
5612
  meta,
4632
5613
  coop,
4633
5614
  vars,
4634
- user: commonUser,
4635
- payment_details: this.formatPaymentDetails(paymentMethod, commonUser.full_name_or_short_name),
4636
- quantity: data.quantity,
4637
- currency: data.currency,
4638
- payment_hash: data.payment_hash
5615
+ user,
5616
+ appendix_hash: data.appendix_hash,
5617
+ short_appendix_hash: this.getShortHash(data.appendix_hash),
5618
+ parent_appendix_hash: data.parent_appendix_hash,
5619
+ short_parent_appendix_hash: this.getShortHash(data.parent_appendix_hash),
5620
+ contributor_contract_number: String(contributorContractUdata.value),
5621
+ contributor_contract_created_at: String(contributorContractCreatedAtUdata.value),
5622
+ component_name: data.component_name,
5623
+ component_hash: data.component_hash,
5624
+ project_name: data.project_name,
5625
+ project_hash: data.project_hash
4639
5626
  };
4640
5627
  await this.validate(combinedData, template.model);
4641
5628
  const translation = template.translations[meta.lang];
4642
- const document = await this.generatePDF(commonUser.full_name_or_short_name, template.context, combinedData, translation, meta, options?.skip_save);
5629
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
4643
5630
  return document;
4644
5631
  }
4645
5632
  };
4646
5633
 
4647
- let Factory$s = class Factory extends DocFactory {
5634
+ let Factory$y = class Factory extends DocFactory {
4648
5635
  constructor(storage) {
4649
5636
  super(storage);
4650
5637
  }
@@ -4655,43 +5642,77 @@ let Factory$s = class Factory extends DocFactory {
4655
5642
  } else {
4656
5643
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$t, data.block_num);
4657
5644
  }
4658
- const user = await super.getUser(data.username, data.block_num);
5645
+ const meta = await this.getMeta({ title: template.title, ...data });
4659
5646
  const coop = await super.getCooperative(data.coopname, data.block_num);
4660
5647
  const vars = await super.getVars(data.coopname, data.block_num);
4661
- const meta = await super.getMeta({
4662
- title: template.title,
4663
- ...data
5648
+ const userData = await super.getUser(data.username, data.block_num);
5649
+ const common_user = super.getCommonUser(userData);
5650
+ const udataService = new Udata(this.storage);
5651
+ const storageAgreementUdata = await udataService.getOne({
5652
+ coopname: data.coopname,
5653
+ username: data.username,
5654
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_STORAGE_AGREEMENT_NUMBER,
5655
+ block_num: data.block_num
4664
5656
  });
4665
- const decision = await super.getDecision(
4666
- coop,
4667
- data.coopname,
4668
- data.decision_id,
4669
- meta.created_at
4670
- );
5657
+ const storageAgreementCreatedAtUdata = await udataService.getOne({
5658
+ coopname: data.coopname,
5659
+ username: data.username,
5660
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_STORAGE_AGREEMENT_CREATED_AT,
5661
+ block_num: data.block_num
5662
+ });
5663
+ const contributorContractUdata = await udataService.getOne({
5664
+ coopname: data.coopname,
5665
+ username: data.username,
5666
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
5667
+ block_num: data.block_num
5668
+ });
5669
+ const generatorAgreementUdata = await udataService.getOne({
5670
+ coopname: data.coopname,
5671
+ username: data.username,
5672
+ key: Cooperative$1.Model.UdataKey.GENERATOR_AGREEMENT_NUMBER,
5673
+ block_num: data.block_num
5674
+ });
5675
+ const generatorAgreementCreatedAtUdata = await udataService.getOne({
5676
+ coopname: data.coopname,
5677
+ username: data.username,
5678
+ key: Cooperative$1.Model.UdataKey.GENERATOR_AGREEMENT_CREATED_AT,
5679
+ block_num: data.block_num
5680
+ });
5681
+ const missingParams = [];
5682
+ if (!storageAgreementUdata?.value)
5683
+ missingParams.push("BLAGOROST_STORAGE_AGREEMENT_NUMBER");
5684
+ if (!storageAgreementCreatedAtUdata?.value)
5685
+ missingParams.push("BLAGOROST_STORAGE_AGREEMENT_CREATED_AT");
5686
+ if (!contributorContractUdata?.value)
5687
+ missingParams.push("BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER");
5688
+ if (!generatorAgreementUdata?.value)
5689
+ missingParams.push("GENERATOR_AGREEMENT_NUMBER");
5690
+ if (!generatorAgreementCreatedAtUdata?.value)
5691
+ missingParams.push("GENERATOR_AGREEMENT_CREATED_AT");
5692
+ if (missingParams.length > 0) {
5693
+ throw new Error(
5694
+ `\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0432 Udata \u0434\u043B\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F ${data.username}: ${missingParams.join(", ")}. \u041D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u0441\u0433\u0435\u043D\u0435\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u0447\u0435\u0440\u0435\u0437 UdataDocumentParametersService.`
5695
+ );
5696
+ }
4671
5697
  const combinedData = {
4672
- vars,
4673
5698
  meta,
4674
5699
  coop,
4675
- decision,
4676
- user: super.getCommonUser(user),
4677
- quantity: data.quantity,
4678
- currency: data.currency
5700
+ vars,
5701
+ common_user,
5702
+ blagorost_storage_agreement_number: String(storageAgreementUdata?.value || ""),
5703
+ blagorost_storage_agreement_created_at: String(storageAgreementCreatedAtUdata?.value || ""),
5704
+ contributor_contract_number: String(contributorContractUdata?.value || ""),
5705
+ generator_agreement_number: String(generatorAgreementUdata?.value || ""),
5706
+ generator_agreement_created_at: String(generatorAgreementCreatedAtUdata?.value || "")
4679
5707
  };
4680
- await super.validate(combinedData, template.model);
5708
+ await this.validate(combinedData, template.model);
4681
5709
  const translation = template.translations[meta.lang];
4682
- const document = await super.generatePDF(
4683
- user.data,
4684
- template.context,
4685
- combinedData,
4686
- translation,
4687
- meta,
4688
- options?.skip_save
4689
- );
5710
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
4690
5711
  return document;
4691
5712
  }
4692
5713
  };
4693
5714
 
4694
- let Factory$r = class Factory extends DocFactory {
5715
+ let Factory$x = class Factory extends DocFactory {
4695
5716
  constructor(storage) {
4696
5717
  super(storage);
4697
5718
  }
@@ -4703,7 +5724,48 @@ let Factory$r = class Factory extends DocFactory {
4703
5724
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$s, data.block_num);
4704
5725
  }
4705
5726
  const meta = await this.getMeta({ title: template.title, ...data });
4706
- const combinedData = { meta };
5727
+ const coop = await super.getCooperative(data.coopname, data.block_num);
5728
+ const vars = await super.getVars(data.coopname, data.block_num);
5729
+ const userData = await super.getUser(data.username, data.block_num);
5730
+ const common_user = super.getCommonUser(userData);
5731
+ const udataService = new Udata(this.storage);
5732
+ const blagorostAgreementUdata = await udataService.getOne({
5733
+ coopname: data.coopname,
5734
+ username: data.username,
5735
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_NUMBER,
5736
+ block_num: data.block_num
5737
+ });
5738
+ const contributorContractUdata = await udataService.getOne({
5739
+ coopname: data.coopname,
5740
+ username: data.username,
5741
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
5742
+ block_num: data.block_num
5743
+ });
5744
+ const contributorContractCreatedAtUdata = await udataService.getOne({
5745
+ coopname: data.coopname,
5746
+ username: data.username,
5747
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT,
5748
+ block_num: data.block_num
5749
+ });
5750
+ const missingParams = [];
5751
+ if (!contributorContractUdata?.value)
5752
+ missingParams.push("BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER");
5753
+ if (!contributorContractCreatedAtUdata?.value)
5754
+ missingParams.push("BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT");
5755
+ if (missingParams.length > 0) {
5756
+ throw new Error(
5757
+ `\u041E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0435 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0432 Udata \u0434\u043B\u044F \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F ${data.username}: ${missingParams.join(", ")}. \u041D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0441\u043D\u0430\u0447\u0430\u043B\u0430 \u0441\u0433\u0435\u043D\u0435\u0440\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u044B \u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442\u043E\u0432 \u0447\u0435\u0440\u0435\u0437 UdataDocumentParametersService.`
5758
+ );
5759
+ }
5760
+ const combinedData = {
5761
+ meta,
5762
+ coop,
5763
+ vars,
5764
+ common_user,
5765
+ blagorost_agreement_number: String(blagorostAgreementUdata?.value || ""),
5766
+ contributor_contract_number: String(contributorContractUdata?.value || ""),
5767
+ contributor_contract_created_at: String(contributorContractCreatedAtUdata?.value || "")
5768
+ };
4707
5769
  await this.validate(combinedData, template.model);
4708
5770
  const translation = template.translations[meta.lang];
4709
5771
  const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
@@ -4711,7 +5773,7 @@ let Factory$r = class Factory extends DocFactory {
4711
5773
  }
4712
5774
  };
4713
5775
 
4714
- let Factory$q = class Factory extends DocFactory {
5776
+ let Factory$w = class Factory extends DocFactory {
4715
5777
  constructor(storage) {
4716
5778
  super(storage);
4717
5779
  }
@@ -4724,7 +5786,20 @@ let Factory$q = class Factory extends DocFactory {
4724
5786
  }
4725
5787
  const meta = await this.getMeta({ title: template.title, ...data });
4726
5788
  const coop = await super.getCooperative(data.coopname, data.block_num);
4727
- const combinedData = { meta, coop };
5789
+ const vars = await super.getVars(data.coopname, data.block_num);
5790
+ const userData = await super.getUser(data.username, data.block_num);
5791
+ const user = super.getCommonUser(userData);
5792
+ const combinedData = {
5793
+ meta,
5794
+ coop,
5795
+ vars,
5796
+ user,
5797
+ project_name: data.project_name,
5798
+ project_hash: data.project_hash,
5799
+ component_name: data.component_name,
5800
+ component_hash: data.component_hash,
5801
+ is_component: data.is_component
5802
+ };
4728
5803
  await this.validate(combinedData, template.model);
4729
5804
  const translation = template.translations[meta.lang];
4730
5805
  const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
@@ -4732,7 +5807,7 @@ let Factory$q = class Factory extends DocFactory {
4732
5807
  }
4733
5808
  };
4734
5809
 
4735
- let Factory$p = class Factory extends DocFactory {
5810
+ let Factory$v = class Factory extends DocFactory {
4736
5811
  constructor(storage) {
4737
5812
  super(storage);
4738
5813
  }
@@ -4743,16 +5818,49 @@ let Factory$p = class Factory extends DocFactory {
4743
5818
  } else {
4744
5819
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$q, data.block_num);
4745
5820
  }
4746
- const meta = await this.getMeta({ title: template.title, ...data });
4747
- const combinedData = { meta };
5821
+ const user = await this.getUser(data.username, data.block_num);
5822
+ const userData = {
5823
+ [user.type]: user.data
5824
+ };
5825
+ const coop = await this.getCooperative(data.coopname, data.block_num);
5826
+ const meta = await this.getMeta({
5827
+ title: template.title,
5828
+ ...data
5829
+ });
5830
+ const decision = await this.getDecision(
5831
+ coop,
5832
+ data.coopname,
5833
+ data.decision_id,
5834
+ meta.created_at
5835
+ );
5836
+ const vars = await super.getVars(data.coopname, data.block_num);
5837
+ const combinedData = {
5838
+ ...userData,
5839
+ meta,
5840
+ coop,
5841
+ decision,
5842
+ project_name: data.project_name,
5843
+ project_hash: data.project_hash,
5844
+ component_name: data.component_name,
5845
+ component_hash: data.component_hash,
5846
+ is_component: data.is_component,
5847
+ vars
5848
+ };
4748
5849
  await this.validate(combinedData, template.model);
4749
5850
  const translation = template.translations[meta.lang];
4750
- const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
5851
+ const document = await this.generatePDF(
5852
+ "",
5853
+ template.context,
5854
+ combinedData,
5855
+ translation,
5856
+ meta,
5857
+ options?.skip_save
5858
+ );
4751
5859
  return document;
4752
5860
  }
4753
5861
  };
4754
5862
 
4755
- let Factory$o = class Factory extends DocFactory {
5863
+ let Factory$u = class Factory extends DocFactory {
4756
5864
  constructor(storage) {
4757
5865
  super(storage);
4758
5866
  }
@@ -4772,7 +5880,7 @@ let Factory$o = class Factory extends DocFactory {
4772
5880
  }
4773
5881
  };
4774
5882
 
4775
- let Factory$n = class Factory extends DocFactory {
5883
+ let Factory$t = class Factory extends DocFactory {
4776
5884
  constructor(storage) {
4777
5885
  super(storage);
4778
5886
  }
@@ -4792,7 +5900,7 @@ let Factory$n = class Factory extends DocFactory {
4792
5900
  }
4793
5901
  };
4794
5902
 
4795
- let Factory$m = class Factory extends DocFactory {
5903
+ let Factory$s = class Factory extends DocFactory {
4796
5904
  constructor(storage) {
4797
5905
  super(storage);
4798
5906
  }
@@ -4804,7 +5912,62 @@ let Factory$m = class Factory extends DocFactory {
4804
5912
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$n, data.block_num);
4805
5913
  }
4806
5914
  const meta = await this.getMeta({ title: template.title, ...data });
4807
- const combinedData = { meta };
5915
+ const coop = await super.getCooperative(data.coopname, data.block_num);
5916
+ const vars = await super.getVars(data.coopname, data.block_num);
5917
+ const userData = await super.getUser(data.username, data.block_num);
5918
+ const common_user = super.getCommonUser(userData);
5919
+ const udataService = new Udata(this.storage);
5920
+ const contributorContractUdata = await udataService.getOne({
5921
+ coopname: data.coopname,
5922
+ username: data.username,
5923
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
5924
+ block_num: data.block_num
5925
+ });
5926
+ if (!contributorContractUdata?.value) {
5927
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
5928
+ }
5929
+ const contributorContractCreatedAtUdata = await udataService.getOne({
5930
+ coopname: data.coopname,
5931
+ username: data.username,
5932
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT,
5933
+ block_num: data.block_num
5934
+ });
5935
+ if (!contributorContractCreatedAtUdata?.value) {
5936
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
5937
+ }
5938
+ const blagorostAgreementUdata = await udataService.getOne({
5939
+ coopname: data.coopname,
5940
+ username: data.username,
5941
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_NUMBER,
5942
+ block_num: data.block_num
5943
+ });
5944
+ if (!blagorostAgreementUdata?.value) {
5945
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u0431\u043B\u0430\u0433\u043E\u0440\u043E\u0441\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
5946
+ }
5947
+ const blagorostAgreementCreatedAtUdata = await udataService.getOne({
5948
+ coopname: data.coopname,
5949
+ username: data.username,
5950
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_CREATED_AT,
5951
+ block_num: data.block_num
5952
+ });
5953
+ if (!blagorostAgreementCreatedAtUdata?.value) {
5954
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u0431\u043B\u0430\u0433\u043E\u0440\u043E\u0441\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
5955
+ }
5956
+ const combinedData = {
5957
+ meta,
5958
+ coop,
5959
+ vars,
5960
+ common_user,
5961
+ appendix_hash: data.appendix_hash,
5962
+ short_appendix_hash: this.getShortHash(data.appendix_hash),
5963
+ contributor_contract_number: String(contributorContractUdata.value),
5964
+ contributor_contract_created_at: String(contributorContractCreatedAtUdata.value),
5965
+ appendix_created_at: data.appendix_created_at,
5966
+ project_hash: data.project_hash,
5967
+ amount: super.formatAsset(data.amount),
5968
+ blagorost_agreement_number: String(blagorostAgreementUdata.value),
5969
+ blagorost_agreement_created_at: String(blagorostAgreementCreatedAtUdata.value)
5970
+ };
4808
5971
  await this.validate(combinedData, template.model);
4809
5972
  const translation = template.translations[meta.lang];
4810
5973
  const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
@@ -4812,7 +5975,7 @@ let Factory$m = class Factory extends DocFactory {
4812
5975
  }
4813
5976
  };
4814
5977
 
4815
- let Factory$l = class Factory extends DocFactory {
5978
+ let Factory$r = class Factory extends DocFactory {
4816
5979
  constructor(storage) {
4817
5980
  super(storage);
4818
5981
  }
@@ -4824,7 +5987,57 @@ let Factory$l = class Factory extends DocFactory {
4824
5987
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$m, data.block_num);
4825
5988
  }
4826
5989
  const meta = await this.getMeta({ title: template.title, ...data });
4827
- const combinedData = { meta };
5990
+ const vars = await super.getVars(data.coopname, data.block_num);
5991
+ const userData = await super.getUser(data.username, data.block_num);
5992
+ const common_user = super.getCommonUser(userData);
5993
+ const udataService = new Udata(this.storage);
5994
+ const contributorContractUdata = await udataService.getOne({
5995
+ coopname: data.coopname,
5996
+ username: data.username,
5997
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
5998
+ block_num: data.block_num
5999
+ });
6000
+ if (!contributorContractUdata?.value) {
6001
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
6002
+ }
6003
+ const contributorContractCreatedAtUdata = await udataService.getOne({
6004
+ coopname: data.coopname,
6005
+ username: data.username,
6006
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT,
6007
+ block_num: data.block_num
6008
+ });
6009
+ if (!contributorContractCreatedAtUdata?.value) {
6010
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
6011
+ }
6012
+ const generatorAgreementUdata = await udataService.getOne({
6013
+ coopname: data.coopname,
6014
+ username: data.username,
6015
+ key: Cooperative$1.Model.UdataKey.GENERATOR_AGREEMENT_NUMBER,
6016
+ block_num: data.block_num
6017
+ });
6018
+ if (!generatorAgreementUdata?.value) {
6019
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
6020
+ }
6021
+ const generatorAgreementCreatedAtUdata = await udataService.getOne({
6022
+ coopname: data.coopname,
6023
+ username: data.username,
6024
+ key: Cooperative$1.Model.UdataKey.GENERATOR_AGREEMENT_CREATED_AT,
6025
+ block_num: data.block_num
6026
+ });
6027
+ if (!generatorAgreementCreatedAtUdata?.value) {
6028
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
6029
+ }
6030
+ const combinedData = {
6031
+ meta,
6032
+ vars,
6033
+ common_user,
6034
+ contributor_contract_number: String(contributorContractUdata.value),
6035
+ contributor_contract_created_at: String(contributorContractCreatedAtUdata.value),
6036
+ generator_agreement_number: String(generatorAgreementUdata.value),
6037
+ generator_agreement_created_at: String(generatorAgreementCreatedAtUdata.value),
6038
+ project_hash: data.project_hash,
6039
+ amount: data.amount
6040
+ };
4828
6041
  await this.validate(combinedData, template.model);
4829
6042
  const translation = template.translations[meta.lang];
4830
6043
  const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
@@ -4832,7 +6045,7 @@ let Factory$l = class Factory extends DocFactory {
4832
6045
  }
4833
6046
  };
4834
6047
 
4835
- let Factory$k = class Factory extends DocFactory {
6048
+ let Factory$q = class Factory extends DocFactory {
4836
6049
  constructor(storage) {
4837
6050
  super(storage);
4838
6051
  }
@@ -4844,7 +6057,15 @@ let Factory$k = class Factory extends DocFactory {
4844
6057
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$l, data.block_num);
4845
6058
  }
4846
6059
  const meta = await this.getMeta({ title: template.title, ...data });
4847
- const combinedData = { meta };
6060
+ const vars = await super.getVars(data.coopname, data.block_num);
6061
+ const userData = await super.getUser(data.username, data.block_num);
6062
+ const common_user = super.getCommonUser(userData);
6063
+ const combinedData = {
6064
+ meta,
6065
+ vars,
6066
+ common_user,
6067
+ amount: data.amount
6068
+ };
4848
6069
  await this.validate(combinedData, template.model);
4849
6070
  const translation = template.translations[meta.lang];
4850
6071
  const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
@@ -4852,7 +6073,7 @@ let Factory$k = class Factory extends DocFactory {
4852
6073
  }
4853
6074
  };
4854
6075
 
4855
- let Factory$j = class Factory extends DocFactory {
6076
+ let Factory$p = class Factory extends DocFactory {
4856
6077
  constructor(storage) {
4857
6078
  super(storage);
4858
6079
  }
@@ -4864,7 +6085,63 @@ let Factory$j = class Factory extends DocFactory {
4864
6085
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$k, data.block_num);
4865
6086
  }
4866
6087
  const meta = await this.getMeta({ title: template.title, ...data });
4867
- const combinedData = { meta };
6088
+ const coop = await super.getCooperative(data.coopname, data.block_num);
6089
+ const vars = await super.getVars(data.coopname, data.block_num);
6090
+ const userData = await super.getUser(data.username, data.block_num);
6091
+ const common_user = super.getCommonUser(userData);
6092
+ const udataService = new Udata(this.storage);
6093
+ const contributorContractUdata = await udataService.getOne({
6094
+ coopname: data.coopname,
6095
+ username: data.username,
6096
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
6097
+ block_num: data.block_num
6098
+ });
6099
+ if (!contributorContractUdata?.value) {
6100
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
6101
+ }
6102
+ const contributorContractCreatedAtUdata = await udataService.getOne({
6103
+ coopname: data.coopname,
6104
+ username: data.username,
6105
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT,
6106
+ block_num: data.block_num
6107
+ });
6108
+ if (!contributorContractCreatedAtUdata?.value) {
6109
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
6110
+ }
6111
+ const blagorostAgreementUdata = await udataService.getOne({
6112
+ coopname: data.coopname,
6113
+ username: data.username,
6114
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_NUMBER,
6115
+ block_num: data.block_num
6116
+ });
6117
+ if (!blagorostAgreementUdata?.value) {
6118
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u0431\u043B\u0430\u0433\u043E\u0440\u043E\u0441\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
6119
+ }
6120
+ const blagorostAgreementCreatedAtUdata = await udataService.getOne({
6121
+ coopname: data.coopname,
6122
+ username: data.username,
6123
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_CREATED_AT,
6124
+ block_num: data.block_num
6125
+ });
6126
+ if (!blagorostAgreementCreatedAtUdata?.value) {
6127
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u0431\u043B\u0430\u0433\u043E\u0440\u043E\u0441\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
6128
+ }
6129
+ const combinedData = {
6130
+ meta,
6131
+ coop,
6132
+ vars,
6133
+ common_user,
6134
+ contributor_contract_number: String(contributorContractUdata.value),
6135
+ contributor_contract_created_at: String(contributorContractCreatedAtUdata.value),
6136
+ blagorost_agreement_number: String(blagorostAgreementUdata.value),
6137
+ blagorost_agreement_created_at: String(blagorostAgreementCreatedAtUdata.value),
6138
+ project_name: data.project_name,
6139
+ component_name: data.component_name,
6140
+ result_hash: data.result_hash,
6141
+ result_short_hash: this.getShortHash(data.result_hash),
6142
+ percent_of_result: data.percent_of_result,
6143
+ total_amount: this.formatAsset(data.total_amount)
6144
+ };
4868
6145
  await this.validate(combinedData, template.model);
4869
6146
  const translation = template.translations[meta.lang];
4870
6147
  const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
@@ -4872,7 +6149,7 @@ let Factory$j = class Factory extends DocFactory {
4872
6149
  }
4873
6150
  };
4874
6151
 
4875
- let Factory$i = class Factory extends DocFactory {
6152
+ let Factory$o = class Factory extends DocFactory {
4876
6153
  constructor(storage) {
4877
6154
  super(storage);
4878
6155
  }
@@ -4883,8 +6160,71 @@ let Factory$i = class Factory extends DocFactory {
4883
6160
  } else {
4884
6161
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$j, data.block_num);
4885
6162
  }
4886
- const meta = await this.getMeta({ title: template.title, ...data });
4887
- const combinedData = { meta };
6163
+ const meta = await this.getMeta({ title: template.title, ...data });
6164
+ const coop = await super.getCooperative(data.coopname, data.block_num);
6165
+ const vars = await super.getVars(data.coopname, data.block_num);
6166
+ const userData = await super.getUser(data.username, data.block_num);
6167
+ const common_user = super.getCommonUser(userData);
6168
+ const decision = await this.getDecision(
6169
+ coop,
6170
+ data.coopname,
6171
+ data.decision_id,
6172
+ meta.created_at
6173
+ );
6174
+ const udataService = new Udata(this.storage);
6175
+ const contributorContractUdata = await udataService.getOne({
6176
+ coopname: data.coopname,
6177
+ username: data.username,
6178
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
6179
+ block_num: data.block_num
6180
+ });
6181
+ if (!contributorContractUdata?.value) {
6182
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
6183
+ }
6184
+ const contributorContractCreatedAtUdata = await udataService.getOne({
6185
+ coopname: data.coopname,
6186
+ username: data.username,
6187
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT,
6188
+ block_num: data.block_num
6189
+ });
6190
+ if (!contributorContractCreatedAtUdata?.value) {
6191
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
6192
+ }
6193
+ const blagorostAgreementUdata = await udataService.getOne({
6194
+ coopname: data.coopname,
6195
+ username: data.username,
6196
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_NUMBER,
6197
+ block_num: data.block_num
6198
+ });
6199
+ if (!blagorostAgreementUdata?.value) {
6200
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u0431\u043B\u0430\u0433\u043E\u0440\u043E\u0441\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
6201
+ }
6202
+ const blagorostAgreementCreatedAtUdata = await udataService.getOne({
6203
+ coopname: data.coopname,
6204
+ username: data.username,
6205
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_CREATED_AT,
6206
+ block_num: data.block_num
6207
+ });
6208
+ if (!blagorostAgreementCreatedAtUdata?.value) {
6209
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u0431\u043B\u0430\u0433\u043E\u0440\u043E\u0441\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
6210
+ }
6211
+ const combinedData = {
6212
+ meta,
6213
+ coop,
6214
+ vars,
6215
+ decision,
6216
+ common_user,
6217
+ contributor_contract_number: String(contributorContractUdata.value),
6218
+ contributor_contract_created_at: String(contributorContractCreatedAtUdata.value),
6219
+ blagorost_agreement_number: String(blagorostAgreementUdata.value),
6220
+ blagorost_agreement_created_at: String(blagorostAgreementCreatedAtUdata.value),
6221
+ project_name: data.project_name,
6222
+ component_name: data.component_name,
6223
+ result_hash: data.result_hash,
6224
+ result_short_hash: this.getShortHash(data.result_hash),
6225
+ percent_of_result: data.percent_of_result,
6226
+ total_amount: this.formatAsset(data.total_amount)
6227
+ };
4888
6228
  await this.validate(combinedData, template.model);
4889
6229
  const translation = template.translations[meta.lang];
4890
6230
  const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
@@ -4892,7 +6232,7 @@ let Factory$i = class Factory extends DocFactory {
4892
6232
  }
4893
6233
  };
4894
6234
 
4895
- let Factory$h = class Factory extends DocFactory {
6235
+ let Factory$n = class Factory extends DocFactory {
4896
6236
  constructor(storage) {
4897
6237
  super(storage);
4898
6238
  }
@@ -4904,7 +6244,64 @@ let Factory$h = class Factory extends DocFactory {
4904
6244
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$i, data.block_num);
4905
6245
  }
4906
6246
  const meta = await this.getMeta({ title: template.title, ...data });
4907
- const combinedData = { meta };
6247
+ const coop = await super.getCooperative(data.coopname, data.block_num);
6248
+ const vars = await super.getVars(data.coopname, data.block_num);
6249
+ const userData = await super.getUser(data.username, data.block_num);
6250
+ const common_user = super.getCommonUser(userData);
6251
+ const decision = await this.getApprovedDecision(coop, data.coopname, data.decision_id);
6252
+ const udataService = new Udata(this.storage);
6253
+ const contributorContractUdata = await udataService.getOne({
6254
+ coopname: data.coopname,
6255
+ username: data.username,
6256
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
6257
+ block_num: data.block_num
6258
+ });
6259
+ if (!contributorContractUdata?.value) {
6260
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
6261
+ }
6262
+ const contributorContractCreatedAtUdata = await udataService.getOne({
6263
+ coopname: data.coopname,
6264
+ username: data.username,
6265
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT,
6266
+ block_num: data.block_num
6267
+ });
6268
+ if (!contributorContractCreatedAtUdata?.value) {
6269
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
6270
+ }
6271
+ const blagorostAgreementUdata = await udataService.getOne({
6272
+ coopname: data.coopname,
6273
+ username: data.username,
6274
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_NUMBER,
6275
+ block_num: data.block_num
6276
+ });
6277
+ if (!blagorostAgreementUdata?.value) {
6278
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u0431\u043B\u0430\u0433\u043E\u0440\u043E\u0441\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
6279
+ }
6280
+ const blagorostAgreementCreatedAtUdata = await udataService.getOne({
6281
+ coopname: data.coopname,
6282
+ username: data.username,
6283
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_AGREEMENT_CREATED_AT,
6284
+ block_num: data.block_num
6285
+ });
6286
+ if (!blagorostAgreementCreatedAtUdata?.value) {
6287
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u0431\u043B\u0430\u0433\u043E\u0440\u043E\u0441\u0442\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
6288
+ }
6289
+ const combinedData = {
6290
+ meta,
6291
+ coop,
6292
+ vars,
6293
+ decision,
6294
+ common_user,
6295
+ contributor_contract_number: String(contributorContractUdata.value),
6296
+ contributor_contract_created_at: String(contributorContractCreatedAtUdata.value),
6297
+ blagorost_agreement_number: String(blagorostAgreementUdata.value),
6298
+ blagorost_agreement_created_at: String(blagorostAgreementCreatedAtUdata.value),
6299
+ result_act_hash: data.result_act_hash,
6300
+ result_act_short_hash: this.getShortHash(data.result_act_hash),
6301
+ result_hash: data.result_hash,
6302
+ percent_of_result: data.percent_of_result,
6303
+ total_amount: this.formatAsset(data.total_amount)
6304
+ };
4908
6305
  await this.validate(combinedData, template.model);
4909
6306
  const translation = template.translations[meta.lang];
4910
6307
  const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
@@ -4912,7 +6309,7 @@ let Factory$h = class Factory extends DocFactory {
4912
6309
  }
4913
6310
  };
4914
6311
 
4915
- let Factory$g = class Factory extends DocFactory {
6312
+ let Factory$m = class Factory extends DocFactory {
4916
6313
  constructor(storage) {
4917
6314
  super(storage);
4918
6315
  }
@@ -4932,7 +6329,7 @@ let Factory$g = class Factory extends DocFactory {
4932
6329
  }
4933
6330
  };
4934
6331
 
4935
- let Factory$f = class Factory extends DocFactory {
6332
+ let Factory$l = class Factory extends DocFactory {
4936
6333
  constructor(storage) {
4937
6334
  super(storage);
4938
6335
  }
@@ -4952,7 +6349,7 @@ let Factory$f = class Factory extends DocFactory {
4952
6349
  }
4953
6350
  };
4954
6351
 
4955
- let Factory$e = class Factory extends DocFactory {
6352
+ let Factory$k = class Factory extends DocFactory {
4956
6353
  constructor(storage) {
4957
6354
  super(storage);
4958
6355
  }
@@ -4972,7 +6369,7 @@ let Factory$e = class Factory extends DocFactory {
4972
6369
  }
4973
6370
  };
4974
6371
 
4975
- let Factory$d = class Factory extends DocFactory {
6372
+ let Factory$j = class Factory extends DocFactory {
4976
6373
  constructor(storage) {
4977
6374
  super(storage);
4978
6375
  }
@@ -4992,7 +6389,7 @@ let Factory$d = class Factory extends DocFactory {
4992
6389
  }
4993
6390
  };
4994
6391
 
4995
- let Factory$c = class Factory extends DocFactory {
6392
+ let Factory$i = class Factory extends DocFactory {
4996
6393
  constructor(storage) {
4997
6394
  super(storage);
4998
6395
  }
@@ -5012,7 +6409,7 @@ let Factory$c = class Factory extends DocFactory {
5012
6409
  }
5013
6410
  };
5014
6411
 
5015
- let Factory$b = class Factory extends DocFactory {
6412
+ let Factory$h = class Factory extends DocFactory {
5016
6413
  constructor(storage) {
5017
6414
  super(storage);
5018
6415
  }
@@ -5032,7 +6429,7 @@ let Factory$b = class Factory extends DocFactory {
5032
6429
  }
5033
6430
  };
5034
6431
 
5035
- let Factory$a = class Factory extends DocFactory {
6432
+ let Factory$g = class Factory extends DocFactory {
5036
6433
  constructor(storage) {
5037
6434
  super(storage);
5038
6435
  }
@@ -5052,7 +6449,7 @@ let Factory$a = class Factory extends DocFactory {
5052
6449
  }
5053
6450
  };
5054
6451
 
5055
- let Factory$9 = class Factory extends DocFactory {
6452
+ let Factory$f = class Factory extends DocFactory {
5056
6453
  constructor(storage) {
5057
6454
  super(storage);
5058
6455
  }
@@ -5072,7 +6469,7 @@ let Factory$9 = class Factory extends DocFactory {
5072
6469
  }
5073
6470
  };
5074
6471
 
5075
- let Factory$8 = class Factory extends DocFactory {
6472
+ let Factory$e = class Factory extends DocFactory {
5076
6473
  constructor(storage) {
5077
6474
  super(storage);
5078
6475
  }
@@ -5084,7 +6481,45 @@ let Factory$8 = class Factory extends DocFactory {
5084
6481
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$9, data.block_num);
5085
6482
  }
5086
6483
  const meta = await this.getMeta({ title: template.title, ...data });
5087
- const combinedData = { meta };
6484
+ const coop = await super.getCooperative(data.coopname, data.block_num);
6485
+ const vars = await super.getVars(data.coopname, data.block_num);
6486
+ const userData = await super.getUser(data.username, data.block_num);
6487
+ const common_user = super.getCommonUser(userData);
6488
+ const udataService = new Udata(this.storage);
6489
+ const contributorContractUdata = await udataService.getOne({
6490
+ coopname: data.coopname,
6491
+ username: data.username,
6492
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER,
6493
+ block_num: data.block_num
6494
+ });
6495
+ if (!contributorContractUdata?.value) {
6496
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
6497
+ }
6498
+ const contributorContractCreatedAtUdata = await udataService.getOne({
6499
+ coopname: data.coopname,
6500
+ username: data.username,
6501
+ key: Cooperative$1.Model.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT,
6502
+ block_num: data.block_num
6503
+ });
6504
+ if (!contributorContractCreatedAtUdata?.value) {
6505
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0434\u043E\u0433\u043E\u0432\u043E\u0440\u0430 \u0423\u0425\u0414 \u0443\u0447\u0430\u0441\u0442\u043D\u0438\u043A\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
6506
+ }
6507
+ const combinedData = {
6508
+ meta,
6509
+ coop,
6510
+ vars,
6511
+ common_user,
6512
+ contributor_contract_number: String(contributorContractUdata.value),
6513
+ contributor_contract_created_at: String(contributorContractCreatedAtUdata.value),
6514
+ appendix_hash: data.appendix_hash,
6515
+ appendix_short_hash: this.getShortHash(data.appendix_hash),
6516
+ project_hash: data.project_hash,
6517
+ project_short_hash: this.getShortHash(data.project_hash),
6518
+ main_wallet_amount: data.main_wallet_amount,
6519
+ blagorost_wallet_amount: data.blagorost_wallet_amount,
6520
+ to_wallet: data.to_wallet,
6521
+ to_blagorost: data.to_blagorost
6522
+ };
5088
6523
  await this.validate(combinedData, template.model);
5089
6524
  const translation = template.translations[meta.lang];
5090
6525
  const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
@@ -5092,7 +6527,7 @@ let Factory$8 = class Factory extends DocFactory {
5092
6527
  }
5093
6528
  };
5094
6529
 
5095
- let Factory$7 = class Factory extends DocFactory {
6530
+ let Factory$d = class Factory extends DocFactory {
5096
6531
  constructor(storage) {
5097
6532
  super(storage);
5098
6533
  }
@@ -5112,7 +6547,7 @@ let Factory$7 = class Factory extends DocFactory {
5112
6547
  }
5113
6548
  };
5114
6549
 
5115
- let Factory$6 = class Factory extends DocFactory {
6550
+ let Factory$c = class Factory extends DocFactory {
5116
6551
  constructor(storage) {
5117
6552
  super(storage);
5118
6553
  }
@@ -5132,7 +6567,7 @@ let Factory$6 = class Factory extends DocFactory {
5132
6567
  }
5133
6568
  };
5134
6569
 
5135
- let Factory$5 = class Factory extends DocFactory {
6570
+ let Factory$b = class Factory extends DocFactory {
5136
6571
  constructor(storage) {
5137
6572
  super(storage);
5138
6573
  }
@@ -5152,7 +6587,7 @@ let Factory$5 = class Factory extends DocFactory {
5152
6587
  }
5153
6588
  };
5154
6589
 
5155
- let Factory$4 = class Factory extends DocFactory {
6590
+ let Factory$a = class Factory extends DocFactory {
5156
6591
  constructor(storage) {
5157
6592
  super(storage);
5158
6593
  }
@@ -5193,7 +6628,7 @@ let Factory$4 = class Factory extends DocFactory {
5193
6628
  }
5194
6629
  };
5195
6630
 
5196
- let Factory$3 = class Factory extends DocFactory {
6631
+ let Factory$9 = class Factory extends DocFactory {
5197
6632
  constructor(storage) {
5198
6633
  super(storage);
5199
6634
  }
@@ -5204,11 +6639,10 @@ let Factory$3 = class Factory extends DocFactory {
5204
6639
  } else {
5205
6640
  template = await this.getTemplate(DraftContract.contractName.production, registry_id$3, data.block_num);
5206
6641
  }
5207
- console.log("data on gerate soviet decision", data);
5208
6642
  const meta = await super.getMeta({ title: template.title, ...data });
5209
6643
  const coop = await super.getCooperative(data.coopname, data.block_num);
5210
6644
  const vars = await super.getVars(data.coopname, data.block_num);
5211
- const decision = await super.getDecision(coop, data.coopname, data.decision_id, meta.created_at);
6645
+ const decision = await super.getApprovedDecision(coop, data.coopname, data.decision_id);
5212
6646
  const meet = await super.getMeet(data.coopname, data.meet_hash, data.block_num);
5213
6647
  const questions = await super.getMeetQuestions(data.coopname, Number(meet.id), data.block_num);
5214
6648
  const combinedData = {
@@ -5234,7 +6668,7 @@ let Factory$3 = class Factory extends DocFactory {
5234
6668
  }
5235
6669
  };
5236
6670
 
5237
- let Factory$2 = class Factory extends DocFactory {
6671
+ let Factory$8 = class Factory extends DocFactory {
5238
6672
  constructor(storage) {
5239
6673
  super(storage);
5240
6674
  }
@@ -5275,7 +6709,7 @@ let Factory$2 = class Factory extends DocFactory {
5275
6709
  }
5276
6710
  };
5277
6711
 
5278
- let Factory$1 = class Factory extends DocFactory {
6712
+ let Factory$7 = class Factory extends DocFactory {
5279
6713
  constructor(storage) {
5280
6714
  super(storage);
5281
6715
  }
@@ -5293,7 +6727,6 @@ let Factory$1 = class Factory extends DocFactory {
5293
6727
  const user = super.getCommonUser(userData);
5294
6728
  const meet = await super.getMeet(data.coopname, data.meet_hash, data.block_num);
5295
6729
  const meetQuestions = await super.getMeetQuestions(data.coopname, Number(meet.id), data.block_num);
5296
- console.log("meetQuestions", meetQuestions);
5297
6730
  const questions = meetQuestions.map((question) => ({
5298
6731
  id: question.id.toString(),
5299
6732
  number: question.number.toString(),
@@ -5326,7 +6759,7 @@ let Factory$1 = class Factory extends DocFactory {
5326
6759
  }
5327
6760
  };
5328
6761
 
5329
- class Factory extends DocFactory {
6762
+ let Factory$6 = class Factory extends DocFactory {
5330
6763
  constructor(storage) {
5331
6764
  super(storage);
5332
6765
  }
@@ -5363,6 +6796,196 @@ class Factory extends DocFactory {
5363
6796
  );
5364
6797
  return document;
5365
6798
  }
6799
+ };
6800
+
6801
+ let Factory$5 = class Factory extends DocFactory {
6802
+ constructor(storage) {
6803
+ super(storage);
6804
+ }
6805
+ async generateDocument(data, options) {
6806
+ let template;
6807
+ if (process.env.SOURCE === "local") {
6808
+ template = Template$D;
6809
+ } else {
6810
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$D, data.block_num);
6811
+ }
6812
+ const meta = await this.getMeta({ title: template.title, ...data });
6813
+ const vars = await this.getVars(data.coopname);
6814
+ const coop = await this.getCooperative(data.coopname);
6815
+ const combinedData = {
6816
+ meta,
6817
+ coop,
6818
+ vars
6819
+ };
6820
+ await this.validate(combinedData, template.model);
6821
+ const translation = template.translations[meta.lang];
6822
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
6823
+ return document;
6824
+ }
6825
+ };
6826
+
6827
+ let Factory$4 = class Factory extends DocFactory {
6828
+ constructor(storage) {
6829
+ super(storage);
6830
+ }
6831
+ async generateDocument(data, options) {
6832
+ let template;
6833
+ if (process.env.SOURCE === "local") {
6834
+ template = Template$C;
6835
+ } else {
6836
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$C, data.block_num);
6837
+ }
6838
+ const meta = await this.getMeta({ title: template.title, ...data });
6839
+ const vars = await this.getVars(data.coopname);
6840
+ const coop = await this.getCooperative(data.coopname);
6841
+ const user = await this.getUser(data.username, data.block_num);
6842
+ const common_user = this.getCommonUser(user);
6843
+ if (!vars.generator_program?.protocol_number || !vars.generator_program?.protocol_day_month_year) {
6844
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u043E\u0431 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0438 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B. \u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u0443\u044E \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0443 \u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430.");
6845
+ }
6846
+ const combinedData = {
6847
+ meta,
6848
+ coop,
6849
+ vars,
6850
+ common_user
6851
+ };
6852
+ await this.validate(combinedData, template.model);
6853
+ const translation = template.translations[meta.lang];
6854
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
6855
+ return document;
6856
+ }
6857
+ };
6858
+
6859
+ let Factory$3 = class Factory extends DocFactory {
6860
+ constructor(storage) {
6861
+ super(storage);
6862
+ }
6863
+ async generateDocument(data, options) {
6864
+ let template;
6865
+ if (process.env.SOURCE === "local") {
6866
+ template = Template$B;
6867
+ } else {
6868
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$B, data.block_num);
6869
+ }
6870
+ const meta = await this.getMeta({ title: template.title, ...data });
6871
+ const vars = await this.getVars(data.coopname);
6872
+ const coop = await this.getCooperative(data.coopname);
6873
+ const user = await this.getUser(data.username, data.block_num);
6874
+ const common_user = this.getCommonUser(user);
6875
+ if (!vars.generator_program?.protocol_number || !vars.generator_program?.protocol_day_month_year) {
6876
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u043E\u0431 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0438 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0439 \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u044B \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B. \u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u0443\u044E \u043F\u0440\u043E\u0433\u0440\u0430\u043C\u043C\u0443 \u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430.");
6877
+ }
6878
+ if (!vars.generator_offer_template?.protocol_number || !vars.generator_offer_template?.protocol_day_month_year) {
6879
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u043E\u0431 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0430 \u043E\u0444\u0435\u0440\u0442\u044B \u0433\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B. \u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u0448\u0430\u0431\u043B\u043E\u043D \u043E\u0444\u0435\u0440\u0442\u044B \u0433\u0435\u043D\u0435\u0440\u0430\u0442\u043E\u0440\u0430 \u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430.");
6880
+ }
6881
+ const udataService = new Udata(this.storage);
6882
+ const generatorAgreementUdata = await udataService.getOne({
6883
+ coopname: data.coopname,
6884
+ username: data.username,
6885
+ key: Cooperative$1.Model.UdataKey.GENERATOR_AGREEMENT_NUMBER,
6886
+ block_num: data.block_num
6887
+ });
6888
+ if (!generatorAgreementUdata?.value) {
6889
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B \u0432 Udata");
6890
+ }
6891
+ const generatorAgreementCreatedAtUdata = await udataService.getOne({
6892
+ coopname: data.coopname,
6893
+ username: data.username,
6894
+ key: Cooperative$1.Model.UdataKey.GENERATOR_AGREEMENT_CREATED_AT,
6895
+ block_num: data.block_num
6896
+ });
6897
+ if (!generatorAgreementCreatedAtUdata?.value) {
6898
+ throw new Error("\u0414\u0430\u0442\u0430 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u044F \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u043E\u043D\u043D\u043E\u0433\u043E \u0441\u043E\u0433\u043B\u0430\u0448\u0435\u043D\u0438\u044F \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0432 Udata");
6899
+ }
6900
+ const combinedData = {
6901
+ meta,
6902
+ coop,
6903
+ vars,
6904
+ common_user,
6905
+ generator_agreement_number: String(generatorAgreementUdata.value),
6906
+ generator_agreement_created_at: String(generatorAgreementCreatedAtUdata.value)
6907
+ };
6908
+ await this.validate(combinedData, template.model);
6909
+ const translation = template.translations[meta.lang];
6910
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
6911
+ return document;
6912
+ }
6913
+ };
6914
+
6915
+ let Factory$2 = class Factory extends DocFactory {
6916
+ constructor(storage) {
6917
+ super(storage);
6918
+ }
6919
+ async generateDocument(data, options) {
6920
+ let template;
6921
+ if (process.env.SOURCE === "local") {
6922
+ template = Template$A;
6923
+ } else {
6924
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$A, data.block_num);
6925
+ }
6926
+ const meta = await this.getMeta({ title: template.title, ...data });
6927
+ const vars = await this.getVars(data.coopname);
6928
+ const combinedData = { meta, vars };
6929
+ await this.validate(combinedData, template.model);
6930
+ const translation = template.translations[meta.lang];
6931
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
6932
+ return document;
6933
+ }
6934
+ };
6935
+
6936
+ let Factory$1 = class Factory extends DocFactory {
6937
+ constructor(storage) {
6938
+ super(storage);
6939
+ }
6940
+ async generateDocument(data, options) {
6941
+ let template;
6942
+ if (process.env.SOURCE === "local") {
6943
+ template = Template$z;
6944
+ } else {
6945
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$z, data.block_num);
6946
+ }
6947
+ const meta = await this.getMeta({ title: template.title, ...data });
6948
+ const vars = await this.getVars(data.coopname);
6949
+ const coop = await this.getCooperative(data.coopname);
6950
+ const combinedData = {
6951
+ meta,
6952
+ coop,
6953
+ vars
6954
+ };
6955
+ await this.validate(combinedData, template.model);
6956
+ const translation = template.translations[meta.lang];
6957
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
6958
+ return document;
6959
+ }
6960
+ };
6961
+
6962
+ class Factory extends DocFactory {
6963
+ constructor(storage) {
6964
+ super(storage);
6965
+ }
6966
+ async generateDocument(data, options) {
6967
+ let template;
6968
+ if (process.env.SOURCE === "local") {
6969
+ template = Template$y;
6970
+ } else {
6971
+ template = await this.getTemplate(DraftContract.contractName.production, registry_id$y, data.block_num);
6972
+ }
6973
+ const meta = await this.getMeta({ title: template.title, ...data });
6974
+ const vars = await this.getVars(data.coopname);
6975
+ const coop = await this.getCooperative(data.coopname);
6976
+ if (!vars.blagorost_program?.protocol_number || !vars.blagorost_program?.protocol_day_month_year) {
6977
+ throw new Error("\u0414\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430 \u043E\u0431 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0438 \u041F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u044F \u043E \u0426\u041F\u041F \xAB\u0411\u041B\u0410\u0413\u041E\u0420\u041E\u0421\u0422\xBB \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u044B. \u0421\u043D\u0430\u0447\u0430\u043B\u0430 \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u0435 \u041F\u043E\u043B\u043E\u0436\u0435\u043D\u0438\u0435 \u0438 \u0441\u043E\u0445\u0440\u0430\u043D\u0438\u0442\u0435 \u0434\u0430\u043D\u043D\u044B\u0435 \u043F\u0440\u043E\u0442\u043E\u043A\u043E\u043B\u0430.");
6978
+ }
6979
+ const combinedData = {
6980
+ meta,
6981
+ coop,
6982
+ vars
6983
+ };
6984
+ await this.validate(combinedData, template.model);
6985
+ const translation = template.translations[meta.lang];
6986
+ const document = await this.generatePDF("", template.context, combinedData, translation, meta, options?.skip_save);
6987
+ return document;
6988
+ }
5366
6989
  }
5367
6990
 
5368
6991
  var __defProp$2 = Object.defineProperty;
@@ -5642,102 +7265,126 @@ class Generator {
5642
7265
  this.storage = new MongoDBConnector(mongoUri);
5643
7266
  this.searchService = new SearchService(this.storage);
5644
7267
  this.factories = {
5645
- [registry_id$L]: new Factory$L(this.storage),
7268
+ [registry_id$W]: new Factory$W(this.storage),
5646
7269
  // 1
5647
- [registry_id$K]: new Factory$K(this.storage),
7270
+ [registry_id$V]: new Factory$V(this.storage),
5648
7271
  // 2
5649
- [registry_id$J]: new Factory$J(this.storage),
7272
+ [registry_id$U]: new Factory$U(this.storage),
5650
7273
  // 3
5651
- [registry_id$I]: new Factory$I(this.storage),
7274
+ [registry_id$T]: new Factory$T(this.storage),
5652
7275
  // 4
5653
- [registry_id$H]: new Factory$H(this.storage),
7276
+ [registry_id$S]: new Factory$S(this.storage),
5654
7277
  // 50
5655
- [registry_id$G]: new Factory$G(this.storage),
7278
+ [registry_id$R]: new Factory$R(this.storage),
5656
7279
  // 51
5657
- [registry_id$F]: new Factory$E(this.storage),
7280
+ [registry_id$Q]: new Factory$P(this.storage),
5658
7281
  // 100
5659
- [registry_id$D]: new Factory$F(this.storage),
7282
+ [registry_id$O]: new Factory$Q(this.storage),
5660
7283
  // 101
5661
7284
  // общее собрание
5662
- [registry_id$4]: new Factory$4(this.storage),
7285
+ [registry_id$4]: new Factory$a(this.storage),
5663
7286
  // 300
5664
- [registry_id$3]: new Factory$3(this.storage),
7287
+ [registry_id$3]: new Factory$9(this.storage),
5665
7288
  // 301
5666
- [registry_id$2]: new Factory$2(this.storage),
7289
+ [registry_id$2]: new Factory$8(this.storage),
5667
7290
  // 302
5668
- [registry_id$1]: new Factory$1(this.storage),
7291
+ [registry_id$1]: new Factory$7(this.storage),
5669
7292
  // 303
5670
- [registry_id]: new Factory(this.storage),
7293
+ [registry_id]: new Factory$6(this.storage),
5671
7294
  // 304
5672
- [registry_id$E]: new Factory$D(this.storage),
7295
+ [registry_id$P]: new Factory$O(this.storage),
5673
7296
  // 501
5674
- [registry_id$C]: new Factory$C(this.storage),
7297
+ [registry_id$N]: new Factory$N(this.storage),
5675
7298
  // 599
5676
- [registry_id$B]: new Factory$B(this.storage),
7299
+ [registry_id$M]: new Factory$M(this.storage),
5677
7300
  // 600
5678
- [registry_id$5]: new Factory$y(this.storage),
7301
+ [registry_id$5]: new Factory$J(this.storage),
5679
7302
  // 699
5680
- [registry_id$A]: new Factory$A(this.storage),
7303
+ [registry_id$L]: new Factory$L(this.storage),
5681
7304
  // 700
5682
- [registry_id$z]: new Factory$z(this.storage),
7305
+ [registry_id$K]: new Factory$K(this.storage),
5683
7306
  // 800
5684
- [registry_id$x]: new Factory$v(this.storage),
7307
+ [registry_id$I]: new Factory$G(this.storage),
5685
7308
  // 801
5686
- [registry_id$v]: new Factory$u(this.storage),
7309
+ [registry_id$G]: new Factory$F(this.storage),
5687
7310
  // 802
5688
- [registry_id$u]: new Factory$t(this.storage),
7311
+ [registry_id$F]: new Factory$E(this.storage),
5689
7312
  // 900
5690
- [registry_id$t]: new Factory$s(this.storage),
7313
+ [registry_id$E]: new Factory$D(this.storage),
5691
7314
  // 901
5692
- [registry_id$y]: new Factory$x(this.storage),
7315
+ // ЦПП ГЕНЕРАТОР
7316
+ [registry_id$D]: new Factory$5(this.storage),
7317
+ // 994
7318
+ [registry_id$C]: new Factory$4(this.storage),
7319
+ // 995
7320
+ [registry_id$B]: new Factory$3(this.storage),
7321
+ // 996
7322
+ // ЦПП БЛАГОРОСТ
7323
+ [registry_id$z]: new Factory$1(this.storage),
7324
+ // 997
7325
+ [registry_id$A]: new Factory$2(this.storage),
7326
+ // 998
7327
+ [registry_id$y]: new Factory(this.storage),
7328
+ // 999
7329
+ [registry_id$x]: new Factory$C(this.storage),
7330
+ // 1000
7331
+ [registry_id$J]: new Factory$I(this.storage),
5693
7332
  // 701
5694
- [registry_id$w]: new Factory$w(this.storage),
7333
+ [registry_id$H]: new Factory$H(this.storage),
5695
7334
  // 702
5696
- [registry_id$s]: new Factory$r(this.storage),
5697
- // 1000
5698
- [registry_id$r]: new Factory$q(this.storage),
7335
+ [registry_id$w]: new Factory$B(this.storage),
5699
7336
  // 1001
5700
- [registry_id$q]: new Factory$p(this.storage),
7337
+ [registry_id$v]: new Factory$A(this.storage),
5701
7338
  // 1002
5702
- [registry_id$p]: new Factory$o(this.storage),
7339
+ [registry_id$u]: new Factory$z(this.storage),
7340
+ // 1003
7341
+ [registry_id$t]: new Factory$y(this.storage),
7342
+ // 1004
7343
+ [registry_id$s]: new Factory$x(this.storage),
7344
+ // 1007
7345
+ [registry_id$r]: new Factory$w(this.storage),
7346
+ // 1005
7347
+ [registry_id$q]: new Factory$v(this.storage),
7348
+ // 1006
7349
+ [registry_id$p]: new Factory$u(this.storage),
5703
7350
  // 1010
5704
- [registry_id$o]: new Factory$n(this.storage),
7351
+ [registry_id$o]: new Factory$t(this.storage),
5705
7352
  // 1011
5706
- [registry_id$n]: new Factory$m(this.storage),
7353
+ [registry_id$n]: new Factory$s(this.storage),
5707
7354
  // 1020
5708
- [registry_id$m]: new Factory$l(this.storage),
7355
+ [registry_id$m]: new Factory$r(this.storage),
5709
7356
  // 1025
5710
- [registry_id$l]: new Factory$k(this.storage),
7357
+ [registry_id$l]: new Factory$q(this.storage),
5711
7358
  // 1030
5712
- [registry_id$k]: new Factory$j(this.storage),
7359
+ [registry_id$k]: new Factory$p(this.storage),
5713
7360
  // 1040
5714
- [registry_id$j]: new Factory$i(this.storage),
7361
+ [registry_id$j]: new Factory$o(this.storage),
5715
7362
  // 1041
5716
- [registry_id$i]: new Factory$h(this.storage),
7363
+ [registry_id$i]: new Factory$n(this.storage),
5717
7364
  // 1042
5718
- [registry_id$h]: new Factory$g(this.storage),
7365
+ [registry_id$h]: new Factory$m(this.storage),
5719
7366
  // 1050
5720
- [registry_id$g]: new Factory$f(this.storage),
7367
+ [registry_id$g]: new Factory$l(this.storage),
5721
7368
  // 1051
5722
- [registry_id$f]: new Factory$e(this.storage),
7369
+ [registry_id$f]: new Factory$k(this.storage),
5723
7370
  // 1060
5724
- [registry_id$e]: new Factory$d(this.storage),
7371
+ [registry_id$e]: new Factory$j(this.storage),
5725
7372
  // 1061
5726
- [registry_id$d]: new Factory$c(this.storage),
7373
+ [registry_id$d]: new Factory$i(this.storage),
5727
7374
  // 1062
5728
- [registry_id$c]: new Factory$b(this.storage),
7375
+ [registry_id$c]: new Factory$h(this.storage),
5729
7376
  // 1070
5730
- [registry_id$b]: new Factory$a(this.storage),
7377
+ [registry_id$b]: new Factory$g(this.storage),
5731
7378
  // 1071
5732
- [registry_id$a]: new Factory$9(this.storage),
7379
+ [registry_id$a]: new Factory$f(this.storage),
5733
7380
  // 1072
5734
- [registry_id$9]: new Factory$8(this.storage),
7381
+ [registry_id$9]: new Factory$e(this.storage),
5735
7382
  // 1080
5736
- [registry_id$8]: new Factory$7(this.storage),
7383
+ [registry_id$8]: new Factory$d(this.storage),
5737
7384
  // 1081
5738
- [registry_id$7]: new Factory$6(this.storage),
7385
+ [registry_id$7]: new Factory$c(this.storage),
5739
7386
  // 1082
5740
- [registry_id$6]: new Factory$5(this.storage)
7387
+ [registry_id$6]: new Factory$b(this.storage)
5741
7388
  // 1090
5742
7389
  };
5743
7390
  await this.storage.connect();
@@ -5760,6 +7407,10 @@ class Generator {
5760
7407
  const model = this.getModel(type, data);
5761
7408
  return model.save();
5762
7409
  }
7410
+ async update(type, filter, data) {
7411
+ const model = this.getModel(type);
7412
+ return model.update(filter, data);
7413
+ }
5763
7414
  async del(type, filter) {
5764
7415
  const model = this.getModel(type);
5765
7416
  return model.del(filter);
@@ -5794,6 +7445,8 @@ class Generator {
5794
7445
  return new Vars(this.storage, data);
5795
7446
  case "project":
5796
7447
  return new Project(this.storage, data);
7448
+ case "udata":
7449
+ return new Udata(this.storage, data);
5797
7450
  default:
5798
7451
  throw new Error(`Unknown type: ${type}`);
5799
7452
  }
@@ -5807,4 +7460,4 @@ class Generator {
5807
7460
  }
5808
7461
  }
5809
7462
 
5810
- export { AgendaMeetSchema, AgendaQuestionSchema, AnnualGeneralMeetingAgenda, AnnualGeneralMeetingDecision, AnnualGeneralMeetingNotification, AnnualGeneralMeetingSovietDecision, AnnualGeneralMeetingVotingBallot, AppendixGenerationAgreement, AssetContributionAct, AssetContributionDecision, AssetContributionStatement, BankAccountSchema, CapitalizationAgreement, CapitalizationMoneyInvestStatement, CapitalizationPropertyInvestAct, CapitalizationPropertyInvestDecision, CapitalizationPropertyInvestStatement, CapitalizationToMainWalletConvertStatement, CommonUserSchema, ConvertToAxonStatement, CoopenomicsAgreement, CooperativeSchema, DecisionOfParticipantApplication, ExpenseDecision, ExpenseStatement, FreeDecision, GenerationAgreement, GenerationMoneyInvestStatement, GenerationMoneyReturnUnusedStatement, GenerationPropertyInvestAct, GenerationPropertyInvestDecision, GenerationPropertyInvestStatement, GenerationToCapitalizationConvertStatement, GenerationToMainWalletConvertStatement, GenerationToProjectConvertStatement, Generator, GetLoanDecision, GetLoanStatement, MeetPointSchema, MeetSchema, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, QuestionExtendedSchema, QuestionSchema$1 as QuestionSchema, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, ResultContributionAct, ResultContributionDecision, ResultContributionStatement, ReturnByAssetAct, ReturnByAssetDecision, ReturnByAssetStatement, ReturnByMoney, ReturnByMoneyDecision, SelectBranchStatement, SosediAgreement, UserAgreement, VarsSchema, WalletAgreement, decisionSchema, entrepreneurSchema, individualSchema, organizationSchema, paymentMethodSchema };
7463
+ export { AgendaMeetSchema, AgendaQuestionSchema, AnnualGeneralMeetingAgenda, AnnualGeneralMeetingDecision, AnnualGeneralMeetingNotification, AnnualGeneralMeetingSovietDecision, AnnualGeneralMeetingVotingBallot, AssetContributionAct, AssetContributionDecision, AssetContributionStatement, BankAccountSchema, BlagorostAgreement, BlagorostOffer, BlagorostOfferTemplate, BlagorostProgramTemplate, CapitalizationMoneyInvestStatement, CapitalizationPropertyInvestAct, CapitalizationPropertyInvestDecision, CapitalizationPropertyInvestStatement, CapitalizationToMainWalletConvertStatement, CommonUserSchema, ComponentGenerationContract, ConvertToAxonStatement, CoopenomicsAgreement, CooperativeSchema, DecisionOfParticipantApplication, ExpenseDecision, ExpenseStatement, FreeDecision, GenerationContract, GenerationContractTemplate, GenerationMoneyInvestStatement, GenerationMoneyReturnUnusedStatement, GenerationPropertyInvestAct, GenerationPropertyInvestDecision, GenerationPropertyInvestStatement, GenerationToCapitalizationConvertStatement, GenerationToMainWalletConvertStatement, GenerationToProjectConvertStatement, Generator, GeneratorOffer, GeneratorOfferTemplate, GeneratorProgramTemplate, GetLoanDecision, GetLoanStatement, InitProjectDecision, InitProjectStatement, MeetPointSchema, MeetSchema, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, ProjectGenerationContract, QuestionExtendedSchema, QuestionSchema$1 as QuestionSchema, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, ResultContributionAct, ResultContributionDecision, ResultContributionStatement, ReturnByAssetAct, ReturnByAssetDecision, ReturnByAssetStatement, ReturnByMoney, ReturnByMoneyDecision, SelectBranchStatement, SosediAgreement, StorageAgreement, UserAgreement, VarsSchema, WalletAgreement, decisionSchema, entrepreneurSchema, individualSchema, organizationSchema, paymentMethodSchema, udataSchema };