@coopenomics/factory 2.2.4 → 2.2.6

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.cjs CHANGED
@@ -366,8 +366,8 @@ const VarsSchema = {
366
366
  additionalProperties: true
367
367
  };
368
368
 
369
- const registry_id$9 = cooptypes.Cooperative.Registry.WalletAgreement.registry_id;
370
- const Schema$9 = {
369
+ const registry_id$b = cooptypes.Cooperative.Registry.WalletAgreement.registry_id;
370
+ const Schema$b = {
371
371
  type: "object",
372
372
  properties: {
373
373
  meta: IMetaJSONSchema,
@@ -377,23 +377,23 @@ const Schema$9 = {
377
377
  required: ["meta", "coop", "vars"],
378
378
  additionalProperties: true
379
379
  };
380
- const Template$9 = {
380
+ const Template$b = {
381
381
  title: cooptypes.Cooperative.Registry.WalletAgreement.title,
382
382
  description: cooptypes.Cooperative.Registry.WalletAgreement.description,
383
- model: Schema$9,
383
+ model: Schema$b,
384
384
  context: cooptypes.Cooperative.Registry.WalletAgreement.context,
385
385
  translations: cooptypes.Cooperative.Registry.WalletAgreement.translations
386
386
  };
387
387
 
388
388
  const WalletAgreement = {
389
389
  __proto__: null,
390
- Schema: Schema$9,
391
- Template: Template$9,
392
- registry_id: registry_id$9
390
+ Schema: Schema$b,
391
+ Template: Template$b,
392
+ registry_id: registry_id$b
393
393
  };
394
394
 
395
- const registry_id$8 = cooptypes.Cooperative.Registry.RegulationElectronicSignature.registry_id;
396
- const Schema$8 = {
395
+ const registry_id$a = cooptypes.Cooperative.Registry.RegulationElectronicSignature.registry_id;
396
+ const Schema$a = {
397
397
  type: "object",
398
398
  properties: {
399
399
  meta: IMetaJSONSchema,
@@ -403,23 +403,23 @@ const Schema$8 = {
403
403
  required: ["meta", "coop", "vars"],
404
404
  additionalProperties: true
405
405
  };
406
- const Template$8 = {
406
+ const Template$a = {
407
407
  title: cooptypes.Cooperative.Registry.RegulationElectronicSignature.title,
408
408
  description: cooptypes.Cooperative.Registry.RegulationElectronicSignature.description,
409
- model: Schema$8,
409
+ model: Schema$a,
410
410
  context: cooptypes.Cooperative.Registry.RegulationElectronicSignature.context,
411
411
  translations: cooptypes.Cooperative.Registry.RegulationElectronicSignature.translations
412
412
  };
413
413
 
414
414
  const RegulationElectronicSignaturet = {
415
415
  __proto__: null,
416
- Schema: Schema$8,
417
- Template: Template$8,
418
- registry_id: registry_id$8
416
+ Schema: Schema$a,
417
+ Template: Template$a,
418
+ registry_id: registry_id$a
419
419
  };
420
420
 
421
- const registry_id$7 = cooptypes.Cooperative.Registry.PrivacyPolicy.registry_id;
422
- const Schema$7 = {
421
+ const registry_id$9 = cooptypes.Cooperative.Registry.PrivacyPolicy.registry_id;
422
+ const Schema$9 = {
423
423
  type: "object",
424
424
  properties: {
425
425
  meta: IMetaJSONSchema,
@@ -429,23 +429,23 @@ const Schema$7 = {
429
429
  required: ["meta", "coop", "vars"],
430
430
  additionalProperties: true
431
431
  };
432
- const Template$7 = {
432
+ const Template$9 = {
433
433
  title: cooptypes.Cooperative.Registry.PrivacyPolicy.title,
434
434
  description: cooptypes.Cooperative.Registry.PrivacyPolicy.description,
435
- model: Schema$7,
435
+ model: Schema$9,
436
436
  context: cooptypes.Cooperative.Registry.PrivacyPolicy.context,
437
437
  translations: cooptypes.Cooperative.Registry.PrivacyPolicy.translations
438
438
  };
439
439
 
440
440
  const PrivacyPolicy = {
441
441
  __proto__: null,
442
- Schema: Schema$7,
443
- Template: Template$7,
444
- registry_id: registry_id$7
442
+ Schema: Schema$9,
443
+ Template: Template$9,
444
+ registry_id: registry_id$9
445
445
  };
446
446
 
447
- const registry_id$6 = cooptypes.Cooperative.Registry.UserAgreement.registry_id;
448
- const Schema$6 = {
447
+ const registry_id$8 = cooptypes.Cooperative.Registry.UserAgreement.registry_id;
448
+ const Schema$8 = {
449
449
  type: "object",
450
450
  properties: {
451
451
  meta: IMetaJSONSchema,
@@ -462,23 +462,23 @@ const Schema$6 = {
462
462
  required: ["meta", "coop", "vars", "user"],
463
463
  additionalProperties: true
464
464
  };
465
- const Template$6 = {
465
+ const Template$8 = {
466
466
  title: cooptypes.Cooperative.Registry.UserAgreement.title,
467
467
  description: cooptypes.Cooperative.Registry.UserAgreement.description,
468
- model: Schema$6,
468
+ model: Schema$8,
469
469
  context: cooptypes.Cooperative.Registry.UserAgreement.context,
470
470
  translations: cooptypes.Cooperative.Registry.UserAgreement.translations
471
471
  };
472
472
 
473
473
  const UserAgreement = {
474
474
  __proto__: null,
475
- Schema: Schema$6,
476
- Template: Template$6,
477
- registry_id: registry_id$6
475
+ Schema: Schema$8,
476
+ Template: Template$8,
477
+ registry_id: registry_id$8
478
478
  };
479
479
 
480
- const registry_id$5 = cooptypes.Cooperative.Registry.CoopenomicsAgreement.registry_id;
481
- const Schema$5 = {
480
+ const registry_id$7 = cooptypes.Cooperative.Registry.CoopenomicsAgreement.registry_id;
481
+ const Schema$7 = {
482
482
  type: "object",
483
483
  properties: {
484
484
  meta: IMetaJSONSchema,
@@ -489,23 +489,23 @@ const Schema$5 = {
489
489
  required: ["meta", "coop", "vars", "partner"],
490
490
  additionalProperties: true
491
491
  };
492
- const Template$5 = {
492
+ const Template$7 = {
493
493
  title: cooptypes.Cooperative.Registry.CoopenomicsAgreement.title,
494
494
  description: cooptypes.Cooperative.Registry.CoopenomicsAgreement.description,
495
- model: Schema$5,
495
+ model: Schema$7,
496
496
  context: cooptypes.Cooperative.Registry.CoopenomicsAgreement.context,
497
497
  translations: cooptypes.Cooperative.Registry.CoopenomicsAgreement.translations
498
498
  };
499
499
 
500
500
  const CoopenomicsAgreement = {
501
501
  __proto__: null,
502
- Schema: Schema$5,
503
- Template: Template$5,
504
- registry_id: registry_id$5
502
+ Schema: Schema$7,
503
+ Template: Template$7,
504
+ registry_id: registry_id$7
505
505
  };
506
506
 
507
- const registry_id$4 = cooptypes.Cooperative.Registry.ParticipantApplication.registry_id;
508
- const Schema$4 = {
507
+ const registry_id$6 = cooptypes.Cooperative.Registry.ParticipantApplication.registry_id;
508
+ const Schema$6 = {
509
509
  type: "object",
510
510
  properties: {
511
511
  type: {
@@ -577,23 +577,23 @@ const Schema$4 = {
577
577
  required: ["meta", "coop", "type", "signature"],
578
578
  additionalProperties: true
579
579
  };
580
- const Template$4 = {
580
+ const Template$6 = {
581
581
  title: cooptypes.Cooperative.Registry.ParticipantApplication.title,
582
582
  description: cooptypes.Cooperative.Registry.ParticipantApplication.description,
583
- model: Schema$4,
583
+ model: Schema$6,
584
584
  context: cooptypes.Cooperative.Registry.ParticipantApplication.context,
585
585
  translations: cooptypes.Cooperative.Registry.ParticipantApplication.translations
586
586
  };
587
587
 
588
588
  const ParticipantApplication = {
589
589
  __proto__: null,
590
- Schema: Schema$4,
591
- Template: Template$4,
592
- registry_id: registry_id$4
590
+ Schema: Schema$6,
591
+ Template: Template$6,
592
+ registry_id: registry_id$6
593
593
  };
594
594
 
595
- const registry_id$3 = cooptypes.Cooperative.Registry.DecisionOfParticipantApplication.registry_id;
596
- const Schema$3 = {
595
+ const registry_id$5 = cooptypes.Cooperative.Registry.DecisionOfParticipantApplication.registry_id;
596
+ const Schema$5 = {
597
597
  type: "object",
598
598
  properties: {
599
599
  type: {
@@ -650,28 +650,30 @@ const Schema$3 = {
650
650
  },
651
651
  required: [...IMetaJSONSchema.required],
652
652
  additionalProperties: true
653
- }
653
+ },
654
+ vars: VarsSchema
654
655
  },
655
656
  required: ["meta", "coop", "type", "decision"],
657
+ // vars не добавляем в обязательные параметры для обратной совместимости (начиная с 2.26)
656
658
  additionalProperties: true
657
659
  };
658
- const Template$3 = {
660
+ const Template$5 = {
659
661
  title: cooptypes.Cooperative.Registry.DecisionOfParticipantApplication.title,
660
662
  description: cooptypes.Cooperative.Registry.DecisionOfParticipantApplication.description,
661
- model: Schema$3,
663
+ model: Schema$5,
662
664
  context: cooptypes.Cooperative.Registry.DecisionOfParticipantApplication.context,
663
665
  translations: cooptypes.Cooperative.Registry.DecisionOfParticipantApplication.translations
664
666
  };
665
667
 
666
668
  const DecisionOfParticipantApplication = {
667
669
  __proto__: null,
668
- Schema: Schema$3,
669
- Template: Template$3,
670
- registry_id: registry_id$3
670
+ Schema: Schema$5,
671
+ Template: Template$5,
672
+ registry_id: registry_id$5
671
673
  };
672
674
 
673
- const registry_id$2 = cooptypes.Cooperative.Registry.SelectBranchStatement.registry_id;
674
- const Schema$2 = {
675
+ const registry_id$4 = cooptypes.Cooperative.Registry.SelectBranchStatement.registry_id;
676
+ const Schema$4 = {
675
677
  type: "object",
676
678
  properties: {
677
679
  type: {
@@ -726,23 +728,23 @@ const Schema$2 = {
726
728
  required: ["meta", "type", "branch", "vars"],
727
729
  additionalProperties: true
728
730
  };
729
- const Template$2 = {
731
+ const Template$4 = {
730
732
  title: cooptypes.Cooperative.Registry.SelectBranchStatement.title,
731
733
  description: cooptypes.Cooperative.Registry.SelectBranchStatement.description,
732
- model: Schema$2,
734
+ model: Schema$4,
733
735
  context: cooptypes.Cooperative.Registry.SelectBranchStatement.context,
734
736
  translations: cooptypes.Cooperative.Registry.SelectBranchStatement.translations
735
737
  };
736
738
 
737
739
  const SelectBranchStatement = {
738
740
  __proto__: null,
739
- Schema: Schema$2,
740
- Template: Template$2,
741
- registry_id: registry_id$2
741
+ Schema: Schema$4,
742
+ Template: Template$4,
743
+ registry_id: registry_id$4
742
744
  };
743
745
 
744
- const registry_id$1 = cooptypes.Cooperative.Registry.ProjectFreeDecision.registry_id;
745
- const Schema$1 = {
746
+ const registry_id$3 = cooptypes.Cooperative.Registry.ProjectFreeDecision.registry_id;
747
+ const Schema$3 = {
746
748
  type: "object",
747
749
  properties: {
748
750
  coop: {
@@ -777,23 +779,23 @@ const Schema$1 = {
777
779
  required: ["meta", "coop", "project", "suggester_name", "vars"],
778
780
  additionalProperties: true
779
781
  };
780
- const Template$1 = {
782
+ const Template$3 = {
781
783
  title: cooptypes.Cooperative.Registry.ProjectFreeDecision.title,
782
784
  description: cooptypes.Cooperative.Registry.ProjectFreeDecision.description,
783
- model: Schema$1,
785
+ model: Schema$3,
784
786
  context: cooptypes.Cooperative.Registry.ProjectFreeDecision.context,
785
787
  translations: cooptypes.Cooperative.Registry.ProjectFreeDecision.translations
786
788
  };
787
789
 
788
790
  const ProjectFreeDecision = {
789
791
  __proto__: null,
790
- Schema: Schema$1,
791
- Template: Template$1,
792
- registry_id: registry_id$1
792
+ Schema: Schema$3,
793
+ Template: Template$3,
794
+ registry_id: registry_id$3
793
795
  };
794
796
 
795
- const registry_id = cooptypes.Cooperative.Registry.FreeDecision.registry_id;
796
- const Schema = {
797
+ const registry_id$2 = cooptypes.Cooperative.Registry.FreeDecision.registry_id;
798
+ const Schema$2 = {
797
799
  type: "object",
798
800
  properties: {
799
801
  coop: {
@@ -829,20 +831,113 @@ const Schema = {
829
831
  },
830
832
  required: ["id", "question", "decision"],
831
833
  additionalProperties: true
832
- }
834
+ },
835
+ vars: VarsSchema
833
836
  },
834
837
  required: ["meta", "coop", "decision", "project"],
838
+ // vars не вносим для обратной совместимости начиная с версии 2.25
835
839
  additionalProperties: true
836
840
  };
837
- const Template = {
841
+ const Template$2 = {
838
842
  title: cooptypes.Cooperative.Registry.FreeDecision.title,
839
843
  description: cooptypes.Cooperative.Registry.FreeDecision.description,
840
- model: Schema,
844
+ model: Schema$2,
841
845
  context: cooptypes.Cooperative.Registry.FreeDecision.context,
842
846
  translations: cooptypes.Cooperative.Registry.FreeDecision.translations
843
847
  };
844
848
 
845
849
  const FreeDecision = {
850
+ __proto__: null,
851
+ Schema: Schema$2,
852
+ Template: Template$2,
853
+ registry_id: registry_id$2
854
+ };
855
+
856
+ const MiddlewareRequestSchema = {
857
+ type: "object",
858
+ properties: {
859
+ hash: { type: "string" },
860
+ title: { type: "string" },
861
+ unit_of_measurement: { type: "string" },
862
+ units: { type: "number" },
863
+ unit_cost: { type: "number" },
864
+ total_cost: { type: "number" },
865
+ currency: { type: "string" },
866
+ type: { type: "string" }
867
+ },
868
+ required: [
869
+ "hash",
870
+ "title",
871
+ "unit_of_measurement",
872
+ "units",
873
+ "unit_cost",
874
+ "total_cost",
875
+ "currency",
876
+ "type"
877
+ ],
878
+ additionalProperties: true
879
+ };
880
+
881
+ const IMiddlewareUserSchema = {
882
+ type: "object",
883
+ properties: {
884
+ full_name: { type: "string" }
885
+ },
886
+ required: ["full_name"],
887
+ additionalProperties: true
888
+ };
889
+
890
+ const registry_id$1 = cooptypes.Cooperative.Registry.AssetContributionStatement.registry_id;
891
+ const Schema$1 = {
892
+ type: "object",
893
+ properties: {
894
+ meta: IMetaJSONSchema,
895
+ coop: CooperativeSchema,
896
+ vars: VarsSchema,
897
+ request: MiddlewareRequestSchema,
898
+ user: IMiddlewareUserSchema,
899
+ currency: { type: "string" }
900
+ },
901
+ required: ["meta", "coop", "vars", "request", "user", "currency"],
902
+ additionalProperties: true
903
+ };
904
+ const Template$1 = {
905
+ title: cooptypes.Cooperative.Registry.AssetContributionStatement.title,
906
+ description: cooptypes.Cooperative.Registry.AssetContributionStatement.description,
907
+ model: Schema$1,
908
+ context: cooptypes.Cooperative.Registry.AssetContributionStatement.context,
909
+ translations: cooptypes.Cooperative.Registry.AssetContributionStatement.translations
910
+ };
911
+
912
+ const AssetContributionStatement = {
913
+ __proto__: null,
914
+ Schema: Schema$1,
915
+ Template: Template$1,
916
+ registry_id: registry_id$1
917
+ };
918
+
919
+ const registry_id = cooptypes.Cooperative.Registry.ReturnByAssetStatement.registry_id;
920
+ const Schema = {
921
+ type: "object",
922
+ properties: {
923
+ meta: IMetaJSONSchema,
924
+ coop: CooperativeSchema,
925
+ vars: VarsSchema,
926
+ request: MiddlewareRequestSchema,
927
+ user: IMiddlewareUserSchema
928
+ },
929
+ required: ["meta", "coop", "vars", "request", "user"],
930
+ additionalProperties: true
931
+ };
932
+ const Template = {
933
+ title: cooptypes.Cooperative.Registry.ReturnByAssetStatement.title,
934
+ description: cooptypes.Cooperative.Registry.ReturnByAssetStatement.description,
935
+ model: Schema,
936
+ context: cooptypes.Cooperative.Registry.ReturnByAssetStatement.context,
937
+ translations: cooptypes.Cooperative.Registry.ReturnByAssetStatement.translations
938
+ };
939
+
940
+ const ReturnByAssetStatement = {
846
941
  __proto__: null,
847
942
  Schema: Schema,
848
943
  Template: Template,
@@ -859,7 +954,9 @@ const Registry = {
859
954
  101: SelectBranchStatement,
860
955
  501: DecisionOfParticipantApplication,
861
956
  599: ProjectFreeDecision,
862
- 600: FreeDecision
957
+ 600: FreeDecision,
958
+ 700: AssetContributionStatement,
959
+ 800: ReturnByAssetStatement
863
960
  };
864
961
 
865
962
  var __defProp$c = Object.defineProperty;
@@ -1480,7 +1577,7 @@ class PDFService {
1480
1577
 
1481
1578
  const name = "@coopenomics/factory";
1482
1579
  const type = "module";
1483
- const version = "2.2.4";
1580
+ const version = "2.2.6";
1484
1581
  const packageManager = "pnpm@9.0.6";
1485
1582
  const description = "";
1486
1583
  const author = "Alex Ant <chairman.voskhod@gmail.com>";
@@ -1529,7 +1626,7 @@ const dependencies = {
1529
1626
  "ajv-formats": "^3.0.1",
1530
1627
  "ajv-i18n": "^4.2.0",
1531
1628
  axios: "^1.7.2",
1532
- cooptypes: "2.2.4",
1629
+ cooptypes: "2.2.6",
1533
1630
  dotenv: "^16.4.5",
1534
1631
  "eosjs-ecc": "^4.0.7",
1535
1632
  handlebars: "^4.7.8",
@@ -1571,7 +1668,7 @@ const pnpm = {
1571
1668
  "vite@>=5.1.0 <=5.1.6": ">=5.1.7"
1572
1669
  }
1573
1670
  };
1574
- const gitHead = "cbfe37dbba00574ec4f1ca354ecf5a4438d72bc1";
1671
+ const gitHead = "d0bd4428bebd6971c23c27d8d26643d72e3f07cb";
1575
1672
  const packageJson = {
1576
1673
  name: name,
1577
1674
  type: type,
@@ -1782,6 +1879,14 @@ class DocFactory {
1782
1879
  }
1783
1880
  return "";
1784
1881
  }
1882
+ getFullParticipantName(data) {
1883
+ if ("first_name" in data) {
1884
+ return `${data.last_name} ${data.first_name} ${data.middle_name}`;
1885
+ } else if ("short_name" in data) {
1886
+ return data.short_name;
1887
+ }
1888
+ return "";
1889
+ }
1785
1890
  async saveDraft(document) {
1786
1891
  await this.storage.saveDraft(document);
1787
1892
  }
@@ -1829,16 +1934,16 @@ class DocFactory {
1829
1934
  }
1830
1935
  }
1831
1936
 
1832
- let Factory$9 = class Factory extends DocFactory {
1937
+ let Factory$b = class Factory extends DocFactory {
1833
1938
  constructor(storage) {
1834
1939
  super(storage);
1835
1940
  }
1836
1941
  async generateDocument(data, options) {
1837
1942
  let template;
1838
1943
  if (process.env.SOURCE === "local") {
1839
- template = Template$9;
1944
+ template = Template$b;
1840
1945
  } else {
1841
- template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$9, data.block_num);
1946
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$b, data.block_num);
1842
1947
  }
1843
1948
  const meta = await super.getMeta({ title: template.title, ...data });
1844
1949
  const coop = await super.getCooperative(data.coopname, data.block_num);
@@ -1856,16 +1961,16 @@ let Factory$9 = class Factory extends DocFactory {
1856
1961
  }
1857
1962
  };
1858
1963
 
1859
- let Factory$8 = class Factory extends DocFactory {
1964
+ let Factory$a = class Factory extends DocFactory {
1860
1965
  constructor(storage) {
1861
1966
  super(storage);
1862
1967
  }
1863
1968
  async generateDocument(data, options) {
1864
1969
  let template;
1865
1970
  if (process.env.SOURCE === "local") {
1866
- template = Template$8;
1971
+ template = Template$a;
1867
1972
  } else {
1868
- template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$8, data.block_num);
1973
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$a, data.block_num);
1869
1974
  }
1870
1975
  const meta = await super.getMeta({ title: template.title, ...data });
1871
1976
  const coop = await super.getCooperative(data.coopname, data.block_num);
@@ -1883,16 +1988,16 @@ let Factory$8 = class Factory extends DocFactory {
1883
1988
  }
1884
1989
  };
1885
1990
 
1886
- let Factory$7 = class Factory extends DocFactory {
1991
+ let Factory$9 = class Factory extends DocFactory {
1887
1992
  constructor(storage) {
1888
1993
  super(storage);
1889
1994
  }
1890
1995
  async generateDocument(data, options) {
1891
1996
  let template;
1892
1997
  if (process.env.SOURCE === "local") {
1893
- template = Template$7;
1998
+ template = Template$9;
1894
1999
  } else {
1895
- template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$7, data.block_num);
2000
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$9, data.block_num);
1896
2001
  }
1897
2002
  const meta = await super.getMeta({ title: template.title, ...data });
1898
2003
  const coop = await super.getCooperative(data.coopname, data.block_num);
@@ -1910,16 +2015,16 @@ let Factory$7 = class Factory extends DocFactory {
1910
2015
  }
1911
2016
  };
1912
2017
 
1913
- let Factory$6 = class Factory extends DocFactory {
2018
+ let Factory$8 = class Factory extends DocFactory {
1914
2019
  constructor(storage) {
1915
2020
  super(storage);
1916
2021
  }
1917
2022
  async generateDocument(data, options) {
1918
2023
  let template;
1919
2024
  if (process.env.SOURCE === "local") {
1920
- template = Template$6;
2025
+ template = Template$8;
1921
2026
  } else {
1922
- template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$6, data.block_num);
2027
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$8, data.block_num);
1923
2028
  }
1924
2029
  const meta = await super.getMeta({ title: template.title, ...data });
1925
2030
  const coop = await super.getCooperative(data.coopname, data.block_num);
@@ -1941,16 +2046,16 @@ let Factory$6 = class Factory extends DocFactory {
1941
2046
  }
1942
2047
  };
1943
2048
 
1944
- let Factory$5 = class Factory extends DocFactory {
2049
+ let Factory$7 = class Factory extends DocFactory {
1945
2050
  constructor(storage) {
1946
2051
  super(storage);
1947
2052
  }
1948
2053
  async generateDocument(data, options) {
1949
2054
  let template;
1950
2055
  if (process.env.SOURCE === "local") {
1951
- template = Template$5;
2056
+ template = Template$7;
1952
2057
  } else {
1953
- template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$5, data.block_num);
2058
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$7, data.block_num);
1954
2059
  }
1955
2060
  const meta = await super.getMeta({ title: template.title, ...data });
1956
2061
  const coop = await super.getCooperative(data.coopname, data.block_num);
@@ -1970,16 +2075,16 @@ let Factory$5 = class Factory extends DocFactory {
1970
2075
  }
1971
2076
  };
1972
2077
 
1973
- let Factory$4 = class Factory extends DocFactory {
2078
+ let Factory$6 = class Factory extends DocFactory {
1974
2079
  constructor(storage) {
1975
2080
  super(storage);
1976
2081
  }
1977
2082
  async generateDocument(data, _options) {
1978
2083
  let template;
1979
2084
  if (process.env.SOURCE === "local") {
1980
- template = Template$2;
2085
+ template = Template$4;
1981
2086
  } else {
1982
- template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$2, data.block_num);
2087
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$4, data.block_num);
1983
2088
  }
1984
2089
  const user = await super.getUser(data.username, data.block_num);
1985
2090
  const userData = {
@@ -2001,16 +2106,16 @@ let Factory$4 = class Factory extends DocFactory {
2001
2106
  }
2002
2107
  };
2003
2108
 
2004
- let Factory$3 = class Factory extends DocFactory {
2109
+ let Factory$5 = class Factory extends DocFactory {
2005
2110
  constructor(storage) {
2006
2111
  super(storage);
2007
2112
  }
2008
2113
  async generateDocument(data, _options) {
2009
2114
  let template;
2010
2115
  if (process.env.SOURCE === "local") {
2011
- template = Template$4;
2116
+ template = Template$6;
2012
2117
  } else {
2013
- template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$4, data.block_num);
2118
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$6, data.block_num);
2014
2119
  }
2015
2120
  const user = await super.getUser(data.username, data.block_num);
2016
2121
  let bank_account = {};
@@ -2023,6 +2128,8 @@ let Factory$3 = class Factory extends DocFactory {
2023
2128
  }
2024
2129
  };
2025
2130
  const coop = await super.getCooperative(data.coopname, data.block_num);
2131
+ const coop_bank_account = await super.getBankAccount(data.coopname, data.block_num);
2132
+ const extended_coop = { ...coop, bank_account: coop_bank_account };
2026
2133
  if (coop.is_branched && !data.braname)
2027
2134
  throw new Error("\u041A\u043E\u043E\u043F\u0435\u0440\u0430\u0442\u0438\u0432\u043D\u044B\u0439 \u0443\u0447\u0430\u0441\u0442\u043E\u043A \u0434\u043E\u043B\u0436\u0435\u043D \u0431\u044B\u0442\u044C \u0443\u043A\u0430\u0437\u0430\u043D");
2028
2135
  let branch;
@@ -2050,7 +2157,7 @@ let Factory$3 = class Factory extends DocFactory {
2050
2157
  }
2051
2158
  }
2052
2159
  const vars = await super.getVars(data.coopname, data.block_num);
2053
- const combinedData = { ...userData, meta, coop, branch, type: user.type, vars, signature };
2160
+ const combinedData = { ...userData, meta, coop: extended_coop, branch, type: user.type, vars, signature };
2054
2161
  await super.validate(combinedData, template.model);
2055
2162
  const translation = template.translations[meta.lang];
2056
2163
  const document = await super.generatePDF(user.data, template.context, combinedData, translation, meta, data.skip_save);
@@ -2058,22 +2165,23 @@ let Factory$3 = class Factory extends DocFactory {
2058
2165
  }
2059
2166
  };
2060
2167
 
2061
- let Factory$2 = class Factory extends DocFactory {
2168
+ let Factory$4 = class Factory extends DocFactory {
2062
2169
  constructor(storage) {
2063
2170
  super(storage);
2064
2171
  }
2065
2172
  async generateDocument(data, options) {
2066
2173
  let template;
2067
2174
  if (process.env.SOURCE === "local") {
2068
- template = Template$3;
2175
+ template = Template$5;
2069
2176
  } else {
2070
- template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$3, data.block_num);
2177
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$5, data.block_num);
2071
2178
  }
2072
2179
  const user = await super.getUser(data.username, data.block_num);
2073
2180
  const userData = {
2074
2181
  [user.type]: user.data
2075
2182
  };
2076
2183
  const coop = await super.getCooperative(data.coopname, data.block_num);
2184
+ const vars = await super.getVars(data.coopname, data.block_num);
2077
2185
  const meta = await super.getMeta({
2078
2186
  title: template.title,
2079
2187
  ...data
@@ -2086,6 +2194,7 @@ let Factory$2 = class Factory extends DocFactory {
2086
2194
  );
2087
2195
  const combinedData = {
2088
2196
  ...userData,
2197
+ vars,
2089
2198
  meta,
2090
2199
  coop,
2091
2200
  type: user.type,
@@ -2105,16 +2214,16 @@ let Factory$2 = class Factory extends DocFactory {
2105
2214
  }
2106
2215
  };
2107
2216
 
2108
- let Factory$1 = class Factory extends DocFactory {
2217
+ let Factory$3 = class Factory extends DocFactory {
2109
2218
  constructor(storage) {
2110
2219
  super(storage);
2111
2220
  }
2112
2221
  async generateDocument(data, options) {
2113
2222
  let template;
2114
2223
  if (process.env.SOURCE === "local") {
2115
- template = Template$1;
2224
+ template = Template$3;
2116
2225
  } else {
2117
- template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$1, data.block_num);
2226
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$3, data.block_num);
2118
2227
  }
2119
2228
  const user = await this.getUser(data.username, data.block_num);
2120
2229
  const suggester_name = await this.getFullName(user.data);
@@ -2150,16 +2259,16 @@ let Factory$1 = class Factory extends DocFactory {
2150
2259
  }
2151
2260
  };
2152
2261
 
2153
- class Factory extends DocFactory {
2262
+ let Factory$2 = class Factory extends DocFactory {
2154
2263
  constructor(storage) {
2155
2264
  super(storage);
2156
2265
  }
2157
2266
  async generateDocument(data, options) {
2158
2267
  let template;
2159
2268
  if (process.env.SOURCE === "local") {
2160
- template = Template;
2269
+ template = Template$2;
2161
2270
  } else {
2162
- template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id, data.block_num);
2271
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$2, data.block_num);
2163
2272
  }
2164
2273
  const user = await this.getUser(data.username, data.block_num);
2165
2274
  const userData = {
@@ -2179,13 +2288,14 @@ class Factory extends DocFactory {
2179
2288
  if (!data.project_id)
2180
2289
  throw new Error("\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 \u043D\u0435 \u0443\u0441\u0442\u0430\u043D\u043E\u0432\u043B\u0435\u043D");
2181
2290
  const project = await this.getProject(data.project_id, data.block_num);
2182
- console.log("project: ", project, data);
2291
+ const vars = await super.getVars(data.coopname, data.block_num);
2183
2292
  const combinedData = {
2184
2293
  ...userData,
2185
2294
  meta,
2186
2295
  coop,
2187
2296
  decision,
2188
- project
2297
+ project,
2298
+ vars
2189
2299
  };
2190
2300
  await this.validate(combinedData, template.model);
2191
2301
  const translation = template.translations[meta.lang];
@@ -2199,6 +2309,72 @@ class Factory extends DocFactory {
2199
2309
  );
2200
2310
  return document;
2201
2311
  }
2312
+ };
2313
+
2314
+ let Factory$1 = class Factory extends DocFactory {
2315
+ constructor(storage) {
2316
+ super(storage);
2317
+ }
2318
+ async generateDocument(data, options) {
2319
+ let template;
2320
+ if (process.env.SOURCE === "local") {
2321
+ template = Template$1;
2322
+ } else {
2323
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id$1, data.block_num);
2324
+ }
2325
+ const meta = await super.getMeta({ title: template.title, ...data });
2326
+ const coop = await super.getCooperative(data.coopname, data.block_num);
2327
+ const vars = await super.getVars(data.coopname, data.block_num);
2328
+ const user = await super.getUser(data.username, data.block_num);
2329
+ const request = data.request;
2330
+ const full_name = await super.getFullParticipantName(user.data);
2331
+ const combinedData = {
2332
+ meta,
2333
+ coop,
2334
+ vars,
2335
+ user: {
2336
+ full_name
2337
+ },
2338
+ request
2339
+ };
2340
+ await super.validate(combinedData, template.model);
2341
+ const translation = template.translations[meta.lang];
2342
+ const document = await super.generatePDF(full_name, template.context, combinedData, translation, meta, options?.skip_save);
2343
+ return document;
2344
+ }
2345
+ };
2346
+
2347
+ class Factory extends DocFactory {
2348
+ constructor(storage) {
2349
+ super(storage);
2350
+ }
2351
+ async generateDocument(data, options) {
2352
+ let template;
2353
+ if (process.env.SOURCE === "local") {
2354
+ template = Template;
2355
+ } else {
2356
+ template = await this.getTemplate(cooptypes.DraftContract.contractName.production, registry_id, data.block_num);
2357
+ }
2358
+ const meta = await this.getMeta({ title: template.title, ...data });
2359
+ const coop = await this.getCooperative(data.coopname, data.block_num);
2360
+ const vars = await this.getVars(data.coopname, data.block_num);
2361
+ const user = await this.getUser(data.username, data.block_num);
2362
+ const request = data.request;
2363
+ const full_name = await this.getFullParticipantName(user.data);
2364
+ const combinedData = {
2365
+ meta,
2366
+ coop,
2367
+ vars,
2368
+ user: {
2369
+ full_name
2370
+ },
2371
+ request
2372
+ };
2373
+ await this.validate(combinedData, template.model);
2374
+ const translation = template.translations[meta.lang];
2375
+ const document = await super.generatePDF(full_name, template.context, combinedData, translation, meta, options?.skip_save);
2376
+ return document;
2377
+ }
2202
2378
  }
2203
2379
 
2204
2380
  var __defProp$1 = Object.defineProperty;
@@ -2263,26 +2439,30 @@ class Generator {
2263
2439
  async connect(mongoUri) {
2264
2440
  this.storage = new MongoDBConnector(mongoUri);
2265
2441
  this.factories = {
2266
- [registry_id$9]: new Factory$9(this.storage),
2442
+ [registry_id$b]: new Factory$b(this.storage),
2267
2443
  // 1
2268
- [registry_id$8]: new Factory$8(this.storage),
2444
+ [registry_id$a]: new Factory$a(this.storage),
2269
2445
  // 2
2270
- [registry_id$7]: new Factory$7(this.storage),
2446
+ [registry_id$9]: new Factory$9(this.storage),
2271
2447
  // 3
2272
- [registry_id$6]: new Factory$6(this.storage),
2448
+ [registry_id$8]: new Factory$8(this.storage),
2273
2449
  // 4
2274
- [registry_id$5]: new Factory$5(this.storage),
2450
+ [registry_id$7]: new Factory$7(this.storage),
2275
2451
  // 50
2276
- [registry_id$4]: new Factory$3(this.storage),
2452
+ [registry_id$6]: new Factory$5(this.storage),
2277
2453
  // 100
2278
- [registry_id$2]: new Factory$4(this.storage),
2454
+ [registry_id$4]: new Factory$6(this.storage),
2279
2455
  // 101
2280
- [registry_id$3]: new Factory$2(this.storage),
2456
+ [registry_id$5]: new Factory$4(this.storage),
2281
2457
  // 501
2282
- [registry_id$1]: new Factory$1(this.storage),
2458
+ [registry_id$3]: new Factory$3(this.storage),
2283
2459
  // 599
2284
- [registry_id]: new Factory(this.storage)
2460
+ [registry_id$2]: new Factory$2(this.storage),
2285
2461
  // 600
2462
+ [registry_id$1]: new Factory$1(this.storage),
2463
+ // 700
2464
+ [registry_id]: new Factory(this.storage)
2465
+ // 800
2286
2466
  };
2287
2467
  await this.storage.connect();
2288
2468
  }
@@ -2347,6 +2527,7 @@ class Generator {
2347
2527
  }
2348
2528
  }
2349
2529
 
2530
+ exports.AssetContributionStatement = AssetContributionStatement;
2350
2531
  exports.BankAccountSchema = BankAccountSchema;
2351
2532
  exports.CoopenomicsAgreement = CoopenomicsAgreement;
2352
2533
  exports.CooperativeSchema = CooperativeSchema;
@@ -2358,6 +2539,7 @@ exports.PrivacyPolicy = PrivacyPolicy;
2358
2539
  exports.ProjectFreeDecision = ProjectFreeDecision;
2359
2540
  exports.Registry = Registry;
2360
2541
  exports.RegulationElectronicSignature = RegulationElectronicSignaturet;
2542
+ exports.ReturnByAssetStatement = ReturnByAssetStatement;
2361
2543
  exports.SelectBranchStatement = SelectBranchStatement;
2362
2544
  exports.UserAgreement = UserAgreement;
2363
2545
  exports.VarsSchema = VarsSchema;