@coopenomics/docs-factory 1.4.0 → 1.5.0

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
@@ -2645,7 +2645,9 @@ const Schema$M = {
2645
2645
  property_description: { type: "string" },
2646
2646
  property_quantity: { type: "string" },
2647
2647
  property_unit: { type: "string" },
2648
- property_amount: { type: "string" }
2648
+ property_amount: { type: "string" },
2649
+ property_form: { type: "string", nullable: true },
2650
+ property_form_label: { type: "string", nullable: true }
2649
2651
  },
2650
2652
  required: ["meta", "coop", "vars", "common_user", "contributor_contract_number", "contributor_contract_created_at", "blagorost_agreement_number", "blagorost_agreement_created_at", "property_hash", "property_short_hash", "property_name", "property_description", "property_quantity", "property_unit", "property_amount"],
2651
2653
  additionalProperties: true
@@ -2684,7 +2686,9 @@ const Schema$L = {
2684
2686
  property_description: { type: "string" },
2685
2687
  property_quantity: { type: "string" },
2686
2688
  property_unit: { type: "string" },
2687
- property_amount: { type: "string" }
2689
+ property_amount: { type: "string" },
2690
+ property_form: { type: "string", nullable: true },
2691
+ property_form_label: { type: "string", nullable: true }
2688
2692
  },
2689
2693
  required: ["meta", "coop", "vars", "decision", "common_user", "contributor_contract_number", "contributor_contract_created_at", "blagorost_agreement_number", "blagorost_agreement_created_at", "property_hash", "property_short_hash", "property_name", "property_description", "property_quantity", "property_unit", "property_amount"],
2690
2694
  additionalProperties: true
@@ -2723,7 +2727,9 @@ const Schema$K = {
2723
2727
  property_description: { type: "string" },
2724
2728
  property_quantity: { type: "string" },
2725
2729
  property_unit: { type: "string" },
2726
- property_amount: { type: "string" }
2730
+ property_amount: { type: "string" },
2731
+ property_form: { type: "string", nullable: true },
2732
+ property_form_label: { type: "string", nullable: true }
2727
2733
  },
2728
2734
  required: ["meta", "coop", "vars", "decision", "common_user", "contributor_contract_number", "contributor_contract_created_at", "blagorost_agreement_number", "blagorost_agreement_created_at", "property_hash", "property_short_hash", "property_name", "property_description", "property_quantity", "property_unit", "property_amount"],
2729
2735
  additionalProperties: true
@@ -5090,7 +5096,7 @@ function latestMinorOf(versions, major) {
5090
5096
 
5091
5097
  const name = "@coopenomics/docs-factory";
5092
5098
  const type = "module";
5093
- const version = "1.4.0";
5099
+ const version = "1.5.0";
5094
5100
  const description = "Фабрика документов цифрового кооператива: сборка документов по шаблонам, сборщики всех видов документов, версии сборщиков";
5095
5101
  const author = "Alex Ant <chairman.voskhod@gmail.com>";
5096
5102
  const license = "MIT";
@@ -8305,6 +8311,17 @@ function propertyPositionFields(data) {
8305
8311
  property_amount: formatAsset(data.property_amount)
8306
8312
  };
8307
8313
  }
8314
+ const PROPERTY_FORM_LABELS = {
8315
+ thing: "\u0412\u0435\u0449\u044C (\u0438\u043C\u0443\u0449\u0435\u0441\u0442\u0432\u043E \u0432 \u043D\u0430\u0442\u0443\u0440\u0430\u043B\u044C\u043D\u043E\u0439 \u0444\u043E\u0440\u043C\u0435)",
8316
+ intangible: "\u041D\u0435\u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044C\u043D\u043E\u0435 \u0438\u043C\u0443\u0449\u0435\u0441\u0442\u0432\u043E \u0432 \u043E\u0431\u044A\u0435\u043A\u0442\u0438\u0432\u043D\u043E\u0439 \u0444\u043E\u0440\u043C\u0435 (\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442, \u043C\u0435\u0442\u043E\u0434\u0438\u043A\u0430, \u0444\u0430\u0439\u043B)"
8317
+ };
8318
+ function propertyFormFields(data) {
8319
+ const form = data.property_form ?? "";
8320
+ return {
8321
+ property_form: form,
8322
+ property_form_label: PROPERTY_FORM_LABELS[form] ?? ""
8323
+ };
8324
+ }
8308
8325
 
8309
8326
  const Factory$O = defineBuilder()({
8310
8327
  registry_id: registry_id$M,
@@ -8334,11 +8351,32 @@ const Factory_1_1$2 = defineBuilder()({
8334
8351
  }),
8335
8352
  signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
8336
8353
  });
8354
+ const Factory_1_2$2 = defineBuilder()({
8355
+ registry_id: registry_id$M,
8356
+ version: "1.2",
8357
+ reads: ({ data, f, s }) => ({
8358
+ coop: () => f.getCooperative(data.coopname, data.block_num),
8359
+ vars: () => f.getVars(data.coopname, data.block_num),
8360
+ userData: () => f.getUser(data.username, data.block_num),
8361
+ contract: () => getBlagorostContractRef(s, data)
8362
+ }),
8363
+ assemble: ({ data, meta, reads: { coop, vars, userData, contract } }) => ({
8364
+ meta,
8365
+ coop,
8366
+ vars,
8367
+ common_user: commonUser(userData),
8368
+ ...contract,
8369
+ ...propertyPositionFields(data),
8370
+ ...propertyFormFields(data)
8371
+ }),
8372
+ signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
8373
+ });
8337
8374
 
8338
8375
  const _1070_CapitalizationPropertyInvestStatement = {
8339
8376
  __proto__: null,
8340
8377
  Factory: Factory$O,
8341
8378
  Factory_1_1: Factory_1_1$2,
8379
+ Factory_1_2: Factory_1_2$2,
8342
8380
  Template: CapitalizationPropertyInvestStatement
8343
8381
  };
8344
8382
 
@@ -8373,11 +8411,35 @@ const Factory_1_1$1 = defineBuilder()({
8373
8411
  ...propertyPositionFields(data)
8374
8412
  })
8375
8413
  });
8414
+ const Factory_1_2$1 = defineBuilder()({
8415
+ registry_id: registry_id$L,
8416
+ version: "1.2",
8417
+ reads: ({ data, f, s }) => ({
8418
+ coop: () => f.getCooperative(data.coopname, data.block_num),
8419
+ vars: () => f.getVars(data.coopname, data.block_num),
8420
+ userData: () => f.getUser(data.username, data.block_num),
8421
+ contract: () => getBlagorostContractRef(s, data)
8422
+ }),
8423
+ derive: ({ data, f, meta, reads: { coop } }) => ({
8424
+ decision: () => f.getDecision(coop, data.coopname, data.decision_id, meta.created_at, meta.timezone)
8425
+ }),
8426
+ assemble: ({ data, meta, reads: { coop, vars, userData, contract }, derived: { decision } }) => ({
8427
+ meta,
8428
+ coop,
8429
+ vars,
8430
+ decision,
8431
+ common_user: commonUser(userData),
8432
+ ...contract,
8433
+ ...propertyPositionFields(data),
8434
+ ...propertyFormFields(data)
8435
+ })
8436
+ });
8376
8437
 
8377
8438
  const _1071_CapitalizationPropertyInvestDecision = {
8378
8439
  __proto__: null,
8379
8440
  Factory: Factory$N,
8380
8441
  Factory_1_1: Factory_1_1$1,
8442
+ Factory_1_2: Factory_1_2$1,
8381
8443
  Template: CapitalizationPropertyInvestDecision
8382
8444
  };
8383
8445
 
@@ -8413,11 +8475,36 @@ const Factory_1_1 = defineBuilder()({
8413
8475
  }),
8414
8476
  signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
8415
8477
  });
8478
+ const Factory_1_2 = defineBuilder()({
8479
+ registry_id: registry_id$K,
8480
+ version: "1.2",
8481
+ reads: ({ data, f, s }) => ({
8482
+ coop: () => f.getCooperative(data.coopname, data.block_num),
8483
+ vars: () => f.getVars(data.coopname, data.block_num),
8484
+ userData: () => f.getUser(data.username, data.block_num),
8485
+ contract: () => getBlagorostContractRef(s, data)
8486
+ }),
8487
+ derive: ({ data, f, reads: { coop } }) => ({
8488
+ decision: () => f.getApprovedDecision(coop, data.coopname, data.decision_id)
8489
+ }),
8490
+ assemble: ({ data, meta, reads: { coop, vars, userData, contract }, derived: { decision } }) => ({
8491
+ meta,
8492
+ coop,
8493
+ vars,
8494
+ decision,
8495
+ common_user: commonUser(userData),
8496
+ ...contract,
8497
+ ...propertyPositionFields(data),
8498
+ ...propertyFormFields(data)
8499
+ }),
8500
+ signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
8501
+ });
8416
8502
 
8417
8503
  const _1072_CapitalizationPropertyInvestAct = {
8418
8504
  __proto__: null,
8419
8505
  Factory: Factory$M,
8420
8506
  Factory_1_1: Factory_1_1,
8507
+ Factory_1_2: Factory_1_2,
8421
8508
  Template: CapitalizationPropertyInvestAct
8422
8509
  };
8423
8510
 
package/dist/index.mjs CHANGED
@@ -2630,7 +2630,9 @@ const Schema$M = {
2630
2630
  property_description: { type: "string" },
2631
2631
  property_quantity: { type: "string" },
2632
2632
  property_unit: { type: "string" },
2633
- property_amount: { type: "string" }
2633
+ property_amount: { type: "string" },
2634
+ property_form: { type: "string", nullable: true },
2635
+ property_form_label: { type: "string", nullable: true }
2634
2636
  },
2635
2637
  required: ["meta", "coop", "vars", "common_user", "contributor_contract_number", "contributor_contract_created_at", "blagorost_agreement_number", "blagorost_agreement_created_at", "property_hash", "property_short_hash", "property_name", "property_description", "property_quantity", "property_unit", "property_amount"],
2636
2638
  additionalProperties: true
@@ -2669,7 +2671,9 @@ const Schema$L = {
2669
2671
  property_description: { type: "string" },
2670
2672
  property_quantity: { type: "string" },
2671
2673
  property_unit: { type: "string" },
2672
- property_amount: { type: "string" }
2674
+ property_amount: { type: "string" },
2675
+ property_form: { type: "string", nullable: true },
2676
+ property_form_label: { type: "string", nullable: true }
2673
2677
  },
2674
2678
  required: ["meta", "coop", "vars", "decision", "common_user", "contributor_contract_number", "contributor_contract_created_at", "blagorost_agreement_number", "blagorost_agreement_created_at", "property_hash", "property_short_hash", "property_name", "property_description", "property_quantity", "property_unit", "property_amount"],
2675
2679
  additionalProperties: true
@@ -2708,7 +2712,9 @@ const Schema$K = {
2708
2712
  property_description: { type: "string" },
2709
2713
  property_quantity: { type: "string" },
2710
2714
  property_unit: { type: "string" },
2711
- property_amount: { type: "string" }
2715
+ property_amount: { type: "string" },
2716
+ property_form: { type: "string", nullable: true },
2717
+ property_form_label: { type: "string", nullable: true }
2712
2718
  },
2713
2719
  required: ["meta", "coop", "vars", "decision", "common_user", "contributor_contract_number", "contributor_contract_created_at", "blagorost_agreement_number", "blagorost_agreement_created_at", "property_hash", "property_short_hash", "property_name", "property_description", "property_quantity", "property_unit", "property_amount"],
2714
2720
  additionalProperties: true
@@ -5075,7 +5081,7 @@ function latestMinorOf(versions, major) {
5075
5081
 
5076
5082
  const name = "@coopenomics/docs-factory";
5077
5083
  const type = "module";
5078
- const version = "1.4.0";
5084
+ const version = "1.5.0";
5079
5085
  const description = "Фабрика документов цифрового кооператива: сборка документов по шаблонам, сборщики всех видов документов, версии сборщиков";
5080
5086
  const author = "Alex Ant <chairman.voskhod@gmail.com>";
5081
5087
  const license = "MIT";
@@ -8290,6 +8296,17 @@ function propertyPositionFields(data) {
8290
8296
  property_amount: formatAsset(data.property_amount)
8291
8297
  };
8292
8298
  }
8299
+ const PROPERTY_FORM_LABELS = {
8300
+ thing: "\u0412\u0435\u0449\u044C (\u0438\u043C\u0443\u0449\u0435\u0441\u0442\u0432\u043E \u0432 \u043D\u0430\u0442\u0443\u0440\u0430\u043B\u044C\u043D\u043E\u0439 \u0444\u043E\u0440\u043C\u0435)",
8301
+ intangible: "\u041D\u0435\u043C\u0430\u0442\u0435\u0440\u0438\u0430\u043B\u044C\u043D\u043E\u0435 \u0438\u043C\u0443\u0449\u0435\u0441\u0442\u0432\u043E \u0432 \u043E\u0431\u044A\u0435\u043A\u0442\u0438\u0432\u043D\u043E\u0439 \u0444\u043E\u0440\u043C\u0435 (\u0434\u043E\u043A\u0443\u043C\u0435\u043D\u0442, \u043C\u0435\u0442\u043E\u0434\u0438\u043A\u0430, \u0444\u0430\u0439\u043B)"
8302
+ };
8303
+ function propertyFormFields(data) {
8304
+ const form = data.property_form ?? "";
8305
+ return {
8306
+ property_form: form,
8307
+ property_form_label: PROPERTY_FORM_LABELS[form] ?? ""
8308
+ };
8309
+ }
8293
8310
 
8294
8311
  const Factory$O = defineBuilder()({
8295
8312
  registry_id: registry_id$M,
@@ -8319,11 +8336,32 @@ const Factory_1_1$2 = defineBuilder()({
8319
8336
  }),
8320
8337
  signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
8321
8338
  });
8339
+ const Factory_1_2$2 = defineBuilder()({
8340
+ registry_id: registry_id$M,
8341
+ version: "1.2",
8342
+ reads: ({ data, f, s }) => ({
8343
+ coop: () => f.getCooperative(data.coopname, data.block_num),
8344
+ vars: () => f.getVars(data.coopname, data.block_num),
8345
+ userData: () => f.getUser(data.username, data.block_num),
8346
+ contract: () => getBlagorostContractRef(s, data)
8347
+ }),
8348
+ assemble: ({ data, meta, reads: { coop, vars, userData, contract } }) => ({
8349
+ meta,
8350
+ coop,
8351
+ vars,
8352
+ common_user: commonUser(userData),
8353
+ ...contract,
8354
+ ...propertyPositionFields(data),
8355
+ ...propertyFormFields(data)
8356
+ }),
8357
+ signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
8358
+ });
8322
8359
 
8323
8360
  const _1070_CapitalizationPropertyInvestStatement = {
8324
8361
  __proto__: null,
8325
8362
  Factory: Factory$O,
8326
8363
  Factory_1_1: Factory_1_1$2,
8364
+ Factory_1_2: Factory_1_2$2,
8327
8365
  Template: CapitalizationPropertyInvestStatement
8328
8366
  };
8329
8367
 
@@ -8358,11 +8396,35 @@ const Factory_1_1$1 = defineBuilder()({
8358
8396
  ...propertyPositionFields(data)
8359
8397
  })
8360
8398
  });
8399
+ const Factory_1_2$1 = defineBuilder()({
8400
+ registry_id: registry_id$L,
8401
+ version: "1.2",
8402
+ reads: ({ data, f, s }) => ({
8403
+ coop: () => f.getCooperative(data.coopname, data.block_num),
8404
+ vars: () => f.getVars(data.coopname, data.block_num),
8405
+ userData: () => f.getUser(data.username, data.block_num),
8406
+ contract: () => getBlagorostContractRef(s, data)
8407
+ }),
8408
+ derive: ({ data, f, meta, reads: { coop } }) => ({
8409
+ decision: () => f.getDecision(coop, data.coopname, data.decision_id, meta.created_at, meta.timezone)
8410
+ }),
8411
+ assemble: ({ data, meta, reads: { coop, vars, userData, contract }, derived: { decision } }) => ({
8412
+ meta,
8413
+ coop,
8414
+ vars,
8415
+ decision,
8416
+ common_user: commonUser(userData),
8417
+ ...contract,
8418
+ ...propertyPositionFields(data),
8419
+ ...propertyFormFields(data)
8420
+ })
8421
+ });
8361
8422
 
8362
8423
  const _1071_CapitalizationPropertyInvestDecision = {
8363
8424
  __proto__: null,
8364
8425
  Factory: Factory$N,
8365
8426
  Factory_1_1: Factory_1_1$1,
8427
+ Factory_1_2: Factory_1_2$1,
8366
8428
  Template: CapitalizationPropertyInvestDecision
8367
8429
  };
8368
8430
 
@@ -8398,11 +8460,36 @@ const Factory_1_1 = defineBuilder()({
8398
8460
  }),
8399
8461
  signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
8400
8462
  });
8463
+ const Factory_1_2 = defineBuilder()({
8464
+ registry_id: registry_id$K,
8465
+ version: "1.2",
8466
+ reads: ({ data, f, s }) => ({
8467
+ coop: () => f.getCooperative(data.coopname, data.block_num),
8468
+ vars: () => f.getVars(data.coopname, data.block_num),
8469
+ userData: () => f.getUser(data.username, data.block_num),
8470
+ contract: () => getBlagorostContractRef(s, data)
8471
+ }),
8472
+ derive: ({ data, f, reads: { coop } }) => ({
8473
+ decision: () => f.getApprovedDecision(coop, data.coopname, data.decision_id)
8474
+ }),
8475
+ assemble: ({ data, meta, reads: { coop, vars, userData, contract }, derived: { decision } }) => ({
8476
+ meta,
8477
+ coop,
8478
+ vars,
8479
+ decision,
8480
+ common_user: commonUser(userData),
8481
+ ...contract,
8482
+ ...propertyPositionFields(data),
8483
+ ...propertyFormFields(data)
8484
+ }),
8485
+ signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
8486
+ });
8401
8487
 
8402
8488
  const _1072_CapitalizationPropertyInvestAct = {
8403
8489
  __proto__: null,
8404
8490
  Factory: Factory$M,
8405
8491
  Factory_1_1: Factory_1_1,
8492
+ Factory_1_2: Factory_1_2,
8406
8493
  Template: CapitalizationPropertyInvestAct
8407
8494
  };
8408
8495
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coopenomics/docs-factory",
3
3
  "type": "module",
4
- "version": "1.4.0",
4
+ "version": "1.5.0",
5
5
  "description": "Фабрика документов цифрового кооператива: сборка документов по шаблонам, сборщики всех видов документов, версии сборщиков",
6
6
  "author": "Alex Ant <chairman.voskhod@gmail.com>",
7
7
  "license": "MIT",
@@ -50,7 +50,7 @@
50
50
  "pdf-lib": "^1.17.1",
51
51
  "pg": "^8.16.3",
52
52
  "uuid": "^11.0.0",
53
- "@coopenomics/docs-templates": "1.4.0"
53
+ "@coopenomics/docs-templates": "1.5.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@antfu/eslint-config": "^2.17.0",