@coopenomics/docs-factory 1.3.0 → 1.4.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 +165 -10
- package/dist/index.mjs +165 -10
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2631,9 +2631,23 @@ const registry_id$M = docsTemplates.Registry.CapitalizationPropertyInvestStateme
|
|
|
2631
2631
|
const Schema$M = {
|
|
2632
2632
|
type: "object",
|
|
2633
2633
|
properties: {
|
|
2634
|
-
meta: IMetaJSONSchema
|
|
2635
|
-
|
|
2636
|
-
|
|
2634
|
+
meta: IMetaJSONSchema,
|
|
2635
|
+
coop: CooperativeSchema,
|
|
2636
|
+
vars: VarsSchema,
|
|
2637
|
+
common_user: CommonUserSchema,
|
|
2638
|
+
contributor_contract_number: { type: "string" },
|
|
2639
|
+
contributor_contract_created_at: { type: "string" },
|
|
2640
|
+
blagorost_agreement_number: { type: "string" },
|
|
2641
|
+
blagorost_agreement_created_at: { type: "string" },
|
|
2642
|
+
property_hash: { type: "string" },
|
|
2643
|
+
property_short_hash: { type: "string" },
|
|
2644
|
+
property_name: { type: "string" },
|
|
2645
|
+
property_description: { type: "string" },
|
|
2646
|
+
property_quantity: { type: "string" },
|
|
2647
|
+
property_unit: { type: "string" },
|
|
2648
|
+
property_amount: { type: "string" }
|
|
2649
|
+
},
|
|
2650
|
+
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"],
|
|
2637
2651
|
additionalProperties: true
|
|
2638
2652
|
};
|
|
2639
2653
|
const Template$M = {
|
|
@@ -2655,9 +2669,24 @@ const registry_id$L = docsTemplates.Registry.CapitalizationPropertyInvestDecisio
|
|
|
2655
2669
|
const Schema$L = {
|
|
2656
2670
|
type: "object",
|
|
2657
2671
|
properties: {
|
|
2658
|
-
meta: IMetaJSONSchema
|
|
2659
|
-
|
|
2660
|
-
|
|
2672
|
+
meta: IMetaJSONSchema,
|
|
2673
|
+
coop: CooperativeSchema,
|
|
2674
|
+
vars: VarsSchema,
|
|
2675
|
+
decision: decisionSchema,
|
|
2676
|
+
common_user: CommonUserSchema,
|
|
2677
|
+
contributor_contract_number: { type: "string" },
|
|
2678
|
+
contributor_contract_created_at: { type: "string" },
|
|
2679
|
+
blagorost_agreement_number: { type: "string" },
|
|
2680
|
+
blagorost_agreement_created_at: { type: "string" },
|
|
2681
|
+
property_hash: { type: "string" },
|
|
2682
|
+
property_short_hash: { type: "string" },
|
|
2683
|
+
property_name: { type: "string" },
|
|
2684
|
+
property_description: { type: "string" },
|
|
2685
|
+
property_quantity: { type: "string" },
|
|
2686
|
+
property_unit: { type: "string" },
|
|
2687
|
+
property_amount: { type: "string" }
|
|
2688
|
+
},
|
|
2689
|
+
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"],
|
|
2661
2690
|
additionalProperties: true
|
|
2662
2691
|
};
|
|
2663
2692
|
const Template$L = {
|
|
@@ -2679,9 +2708,24 @@ const registry_id$K = docsTemplates.Registry.CapitalizationPropertyInvestAct.reg
|
|
|
2679
2708
|
const Schema$K = {
|
|
2680
2709
|
type: "object",
|
|
2681
2710
|
properties: {
|
|
2682
|
-
meta: IMetaJSONSchema
|
|
2683
|
-
|
|
2684
|
-
|
|
2711
|
+
meta: IMetaJSONSchema,
|
|
2712
|
+
coop: CooperativeSchema,
|
|
2713
|
+
vars: VarsSchema,
|
|
2714
|
+
decision: decisionSchema,
|
|
2715
|
+
common_user: CommonUserSchema,
|
|
2716
|
+
contributor_contract_number: { type: "string" },
|
|
2717
|
+
contributor_contract_created_at: { type: "string" },
|
|
2718
|
+
blagorost_agreement_number: { type: "string" },
|
|
2719
|
+
blagorost_agreement_created_at: { type: "string" },
|
|
2720
|
+
property_hash: { type: "string" },
|
|
2721
|
+
property_short_hash: { type: "string" },
|
|
2722
|
+
property_name: { type: "string" },
|
|
2723
|
+
property_description: { type: "string" },
|
|
2724
|
+
property_quantity: { type: "string" },
|
|
2725
|
+
property_unit: { type: "string" },
|
|
2726
|
+
property_amount: { type: "string" }
|
|
2727
|
+
},
|
|
2728
|
+
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"],
|
|
2685
2729
|
additionalProperties: true
|
|
2686
2730
|
};
|
|
2687
2731
|
const Template$K = {
|
|
@@ -5046,7 +5090,7 @@ function latestMinorOf(versions, major) {
|
|
|
5046
5090
|
|
|
5047
5091
|
const name = "@coopenomics/docs-factory";
|
|
5048
5092
|
const type = "module";
|
|
5049
|
-
const version = "1.
|
|
5093
|
+
const version = "1.4.0";
|
|
5050
5094
|
const description = "Фабрика документов цифрового кооператива: сборка документов по шаблонам, сборщики всех видов документов, версии сборщиков";
|
|
5051
5095
|
const author = "Alex Ant <chairman.voskhod@gmail.com>";
|
|
5052
5096
|
const license = "MIT";
|
|
@@ -8227,16 +8271,74 @@ const _1062_GenerationPropertyInvestAct = {
|
|
|
8227
8271
|
Template: GenerationPropertyInvestAct
|
|
8228
8272
|
};
|
|
8229
8273
|
|
|
8274
|
+
async function getBlagorostContractRef(sources, data) {
|
|
8275
|
+
const read = (key) => sources.udata({ coopname: data.coopname, username: data.username, key, block_num: data.block_num });
|
|
8276
|
+
const [contractNumber, contractCreatedAt, agreementNumber, agreementCreatedAt] = await Promise.all([
|
|
8277
|
+
read(docsTemplates.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER),
|
|
8278
|
+
read(docsTemplates.UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT),
|
|
8279
|
+
read(docsTemplates.UdataKey.BLAGOROST_AGREEMENT_NUMBER),
|
|
8280
|
+
read(docsTemplates.UdataKey.BLAGOROST_AGREEMENT_CREATED_AT)
|
|
8281
|
+
]);
|
|
8282
|
+
if (!contractNumber?.value)
|
|
8283
|
+
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");
|
|
8284
|
+
if (!contractCreatedAt?.value)
|
|
8285
|
+
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");
|
|
8286
|
+
if (!agreementNumber?.value)
|
|
8287
|
+
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");
|
|
8288
|
+
if (!agreementCreatedAt?.value)
|
|
8289
|
+
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");
|
|
8290
|
+
return {
|
|
8291
|
+
contributor_contract_number: String(contractNumber.value),
|
|
8292
|
+
contributor_contract_created_at: String(contractCreatedAt.value),
|
|
8293
|
+
blagorost_agreement_number: String(agreementNumber.value),
|
|
8294
|
+
blagorost_agreement_created_at: String(agreementCreatedAt.value)
|
|
8295
|
+
};
|
|
8296
|
+
}
|
|
8297
|
+
function propertyPositionFields(data) {
|
|
8298
|
+
return {
|
|
8299
|
+
property_hash: data.property_hash,
|
|
8300
|
+
property_short_hash: shortHash(data.property_hash),
|
|
8301
|
+
property_name: data.property_name,
|
|
8302
|
+
property_description: data.property_description,
|
|
8303
|
+
property_quantity: data.property_quantity,
|
|
8304
|
+
property_unit: data.property_unit,
|
|
8305
|
+
property_amount: formatAsset(data.property_amount)
|
|
8306
|
+
};
|
|
8307
|
+
}
|
|
8308
|
+
|
|
8230
8309
|
const Factory$O = defineBuilder()({
|
|
8231
8310
|
registry_id: registry_id$M,
|
|
8232
8311
|
version: "1.0",
|
|
8233
8312
|
reads: () => ({}),
|
|
8313
|
+
// Заглушка 1.0 собирала только мету и документов в цепях не дала; модель шаблона
|
|
8314
|
+
// с версии 1.1 шире (позиция имущества, реквизиты договоров). Код версии заморожен.
|
|
8315
|
+
// @ts-expect-error модель 1.1 требует полей, которых у заглушки нет
|
|
8234
8316
|
assemble: ({ meta }) => ({ meta })
|
|
8235
8317
|
});
|
|
8318
|
+
const Factory_1_1$2 = defineBuilder()({
|
|
8319
|
+
registry_id: registry_id$M,
|
|
8320
|
+
version: "1.1",
|
|
8321
|
+
reads: ({ data, f, s }) => ({
|
|
8322
|
+
coop: () => f.getCooperative(data.coopname, data.block_num),
|
|
8323
|
+
vars: () => f.getVars(data.coopname, data.block_num),
|
|
8324
|
+
userData: () => f.getUser(data.username, data.block_num),
|
|
8325
|
+
contract: () => getBlagorostContractRef(s, data)
|
|
8326
|
+
}),
|
|
8327
|
+
assemble: ({ data, meta, reads: { coop, vars, userData, contract } }) => ({
|
|
8328
|
+
meta,
|
|
8329
|
+
coop,
|
|
8330
|
+
vars,
|
|
8331
|
+
common_user: commonUser(userData),
|
|
8332
|
+
...contract,
|
|
8333
|
+
...propertyPositionFields(data)
|
|
8334
|
+
}),
|
|
8335
|
+
signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
|
|
8336
|
+
});
|
|
8236
8337
|
|
|
8237
8338
|
const _1070_CapitalizationPropertyInvestStatement = {
|
|
8238
8339
|
__proto__: null,
|
|
8239
8340
|
Factory: Factory$O,
|
|
8341
|
+
Factory_1_1: Factory_1_1$2,
|
|
8240
8342
|
Template: CapitalizationPropertyInvestStatement
|
|
8241
8343
|
};
|
|
8242
8344
|
|
|
@@ -8244,12 +8346,38 @@ const Factory$N = defineBuilder()({
|
|
|
8244
8346
|
registry_id: registry_id$L,
|
|
8245
8347
|
version: "1.0",
|
|
8246
8348
|
reads: () => ({}),
|
|
8349
|
+
// Заглушка 1.0 собирала только мету и документов в цепях не дала; модель шаблона
|
|
8350
|
+
// с версии 1.1 шире (позиция имущества, реквизиты договоров). Код версии заморожен.
|
|
8351
|
+
// @ts-expect-error модель 1.1 требует полей, которых у заглушки нет
|
|
8247
8352
|
assemble: ({ meta }) => ({ meta })
|
|
8248
8353
|
});
|
|
8354
|
+
const Factory_1_1$1 = defineBuilder()({
|
|
8355
|
+
registry_id: registry_id$L,
|
|
8356
|
+
version: "1.1",
|
|
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
|
+
derive: ({ data, f, meta, reads: { coop } }) => ({
|
|
8364
|
+
decision: () => f.getDecision(coop, data.coopname, data.decision_id, meta.created_at, meta.timezone)
|
|
8365
|
+
}),
|
|
8366
|
+
assemble: ({ data, meta, reads: { coop, vars, userData, contract }, derived: { decision } }) => ({
|
|
8367
|
+
meta,
|
|
8368
|
+
coop,
|
|
8369
|
+
vars,
|
|
8370
|
+
decision,
|
|
8371
|
+
common_user: commonUser(userData),
|
|
8372
|
+
...contract,
|
|
8373
|
+
...propertyPositionFields(data)
|
|
8374
|
+
})
|
|
8375
|
+
});
|
|
8249
8376
|
|
|
8250
8377
|
const _1071_CapitalizationPropertyInvestDecision = {
|
|
8251
8378
|
__proto__: null,
|
|
8252
8379
|
Factory: Factory$N,
|
|
8380
|
+
Factory_1_1: Factory_1_1$1,
|
|
8253
8381
|
Template: CapitalizationPropertyInvestDecision
|
|
8254
8382
|
};
|
|
8255
8383
|
|
|
@@ -8257,12 +8385,39 @@ const Factory$M = defineBuilder()({
|
|
|
8257
8385
|
registry_id: registry_id$K,
|
|
8258
8386
|
version: "1.0",
|
|
8259
8387
|
reads: () => ({}),
|
|
8388
|
+
// Заглушка 1.0 собирала только мету и документов в цепях не дала; модель шаблона
|
|
8389
|
+
// с версии 1.1 шире (позиция имущества, реквизиты договоров). Код версии заморожен.
|
|
8390
|
+
// @ts-expect-error модель 1.1 требует полей, которых у заглушки нет
|
|
8260
8391
|
assemble: ({ meta }) => ({ meta })
|
|
8261
8392
|
});
|
|
8393
|
+
const Factory_1_1 = defineBuilder()({
|
|
8394
|
+
registry_id: registry_id$K,
|
|
8395
|
+
version: "1.1",
|
|
8396
|
+
reads: ({ data, f, s }) => ({
|
|
8397
|
+
coop: () => f.getCooperative(data.coopname, data.block_num),
|
|
8398
|
+
vars: () => f.getVars(data.coopname, data.block_num),
|
|
8399
|
+
userData: () => f.getUser(data.username, data.block_num),
|
|
8400
|
+
contract: () => getBlagorostContractRef(s, data)
|
|
8401
|
+
}),
|
|
8402
|
+
derive: ({ data, f, reads: { coop } }) => ({
|
|
8403
|
+
decision: () => f.getApprovedDecision(coop, data.coopname, data.decision_id)
|
|
8404
|
+
}),
|
|
8405
|
+
assemble: ({ data, meta, reads: { coop, vars, userData, contract }, derived: { decision } }) => ({
|
|
8406
|
+
meta,
|
|
8407
|
+
coop,
|
|
8408
|
+
vars,
|
|
8409
|
+
decision,
|
|
8410
|
+
common_user: commonUser(userData),
|
|
8411
|
+
...contract,
|
|
8412
|
+
...propertyPositionFields(data)
|
|
8413
|
+
}),
|
|
8414
|
+
signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
|
|
8415
|
+
});
|
|
8262
8416
|
|
|
8263
8417
|
const _1072_CapitalizationPropertyInvestAct = {
|
|
8264
8418
|
__proto__: null,
|
|
8265
8419
|
Factory: Factory$M,
|
|
8420
|
+
Factory_1_1: Factory_1_1,
|
|
8266
8421
|
Template: CapitalizationPropertyInvestAct
|
|
8267
8422
|
};
|
|
8268
8423
|
|
package/dist/index.mjs
CHANGED
|
@@ -2616,9 +2616,23 @@ const registry_id$M = Registry$1.CapitalizationPropertyInvestStatement.registry_
|
|
|
2616
2616
|
const Schema$M = {
|
|
2617
2617
|
type: "object",
|
|
2618
2618
|
properties: {
|
|
2619
|
-
meta: IMetaJSONSchema
|
|
2620
|
-
|
|
2621
|
-
|
|
2619
|
+
meta: IMetaJSONSchema,
|
|
2620
|
+
coop: CooperativeSchema,
|
|
2621
|
+
vars: VarsSchema,
|
|
2622
|
+
common_user: CommonUserSchema,
|
|
2623
|
+
contributor_contract_number: { type: "string" },
|
|
2624
|
+
contributor_contract_created_at: { type: "string" },
|
|
2625
|
+
blagorost_agreement_number: { type: "string" },
|
|
2626
|
+
blagorost_agreement_created_at: { type: "string" },
|
|
2627
|
+
property_hash: { type: "string" },
|
|
2628
|
+
property_short_hash: { type: "string" },
|
|
2629
|
+
property_name: { type: "string" },
|
|
2630
|
+
property_description: { type: "string" },
|
|
2631
|
+
property_quantity: { type: "string" },
|
|
2632
|
+
property_unit: { type: "string" },
|
|
2633
|
+
property_amount: { type: "string" }
|
|
2634
|
+
},
|
|
2635
|
+
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"],
|
|
2622
2636
|
additionalProperties: true
|
|
2623
2637
|
};
|
|
2624
2638
|
const Template$M = {
|
|
@@ -2640,9 +2654,24 @@ const registry_id$L = Registry$1.CapitalizationPropertyInvestDecision.registry_i
|
|
|
2640
2654
|
const Schema$L = {
|
|
2641
2655
|
type: "object",
|
|
2642
2656
|
properties: {
|
|
2643
|
-
meta: IMetaJSONSchema
|
|
2644
|
-
|
|
2645
|
-
|
|
2657
|
+
meta: IMetaJSONSchema,
|
|
2658
|
+
coop: CooperativeSchema,
|
|
2659
|
+
vars: VarsSchema,
|
|
2660
|
+
decision: decisionSchema,
|
|
2661
|
+
common_user: CommonUserSchema,
|
|
2662
|
+
contributor_contract_number: { type: "string" },
|
|
2663
|
+
contributor_contract_created_at: { type: "string" },
|
|
2664
|
+
blagorost_agreement_number: { type: "string" },
|
|
2665
|
+
blagorost_agreement_created_at: { type: "string" },
|
|
2666
|
+
property_hash: { type: "string" },
|
|
2667
|
+
property_short_hash: { type: "string" },
|
|
2668
|
+
property_name: { type: "string" },
|
|
2669
|
+
property_description: { type: "string" },
|
|
2670
|
+
property_quantity: { type: "string" },
|
|
2671
|
+
property_unit: { type: "string" },
|
|
2672
|
+
property_amount: { type: "string" }
|
|
2673
|
+
},
|
|
2674
|
+
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"],
|
|
2646
2675
|
additionalProperties: true
|
|
2647
2676
|
};
|
|
2648
2677
|
const Template$L = {
|
|
@@ -2664,9 +2693,24 @@ const registry_id$K = Registry$1.CapitalizationPropertyInvestAct.registry_id;
|
|
|
2664
2693
|
const Schema$K = {
|
|
2665
2694
|
type: "object",
|
|
2666
2695
|
properties: {
|
|
2667
|
-
meta: IMetaJSONSchema
|
|
2668
|
-
|
|
2669
|
-
|
|
2696
|
+
meta: IMetaJSONSchema,
|
|
2697
|
+
coop: CooperativeSchema,
|
|
2698
|
+
vars: VarsSchema,
|
|
2699
|
+
decision: decisionSchema,
|
|
2700
|
+
common_user: CommonUserSchema,
|
|
2701
|
+
contributor_contract_number: { type: "string" },
|
|
2702
|
+
contributor_contract_created_at: { type: "string" },
|
|
2703
|
+
blagorost_agreement_number: { type: "string" },
|
|
2704
|
+
blagorost_agreement_created_at: { type: "string" },
|
|
2705
|
+
property_hash: { type: "string" },
|
|
2706
|
+
property_short_hash: { type: "string" },
|
|
2707
|
+
property_name: { type: "string" },
|
|
2708
|
+
property_description: { type: "string" },
|
|
2709
|
+
property_quantity: { type: "string" },
|
|
2710
|
+
property_unit: { type: "string" },
|
|
2711
|
+
property_amount: { type: "string" }
|
|
2712
|
+
},
|
|
2713
|
+
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"],
|
|
2670
2714
|
additionalProperties: true
|
|
2671
2715
|
};
|
|
2672
2716
|
const Template$K = {
|
|
@@ -5031,7 +5075,7 @@ function latestMinorOf(versions, major) {
|
|
|
5031
5075
|
|
|
5032
5076
|
const name = "@coopenomics/docs-factory";
|
|
5033
5077
|
const type = "module";
|
|
5034
|
-
const version = "1.
|
|
5078
|
+
const version = "1.4.0";
|
|
5035
5079
|
const description = "Фабрика документов цифрового кооператива: сборка документов по шаблонам, сборщики всех видов документов, версии сборщиков";
|
|
5036
5080
|
const author = "Alex Ant <chairman.voskhod@gmail.com>";
|
|
5037
5081
|
const license = "MIT";
|
|
@@ -8212,16 +8256,74 @@ const _1062_GenerationPropertyInvestAct = {
|
|
|
8212
8256
|
Template: GenerationPropertyInvestAct
|
|
8213
8257
|
};
|
|
8214
8258
|
|
|
8259
|
+
async function getBlagorostContractRef(sources, data) {
|
|
8260
|
+
const read = (key) => sources.udata({ coopname: data.coopname, username: data.username, key, block_num: data.block_num });
|
|
8261
|
+
const [contractNumber, contractCreatedAt, agreementNumber, agreementCreatedAt] = await Promise.all([
|
|
8262
|
+
read(UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_NUMBER),
|
|
8263
|
+
read(UdataKey.BLAGOROST_CONTRIBUTOR_CONTRACT_CREATED_AT),
|
|
8264
|
+
read(UdataKey.BLAGOROST_AGREEMENT_NUMBER),
|
|
8265
|
+
read(UdataKey.BLAGOROST_AGREEMENT_CREATED_AT)
|
|
8266
|
+
]);
|
|
8267
|
+
if (!contractNumber?.value)
|
|
8268
|
+
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");
|
|
8269
|
+
if (!contractCreatedAt?.value)
|
|
8270
|
+
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");
|
|
8271
|
+
if (!agreementNumber?.value)
|
|
8272
|
+
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");
|
|
8273
|
+
if (!agreementCreatedAt?.value)
|
|
8274
|
+
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");
|
|
8275
|
+
return {
|
|
8276
|
+
contributor_contract_number: String(contractNumber.value),
|
|
8277
|
+
contributor_contract_created_at: String(contractCreatedAt.value),
|
|
8278
|
+
blagorost_agreement_number: String(agreementNumber.value),
|
|
8279
|
+
blagorost_agreement_created_at: String(agreementCreatedAt.value)
|
|
8280
|
+
};
|
|
8281
|
+
}
|
|
8282
|
+
function propertyPositionFields(data) {
|
|
8283
|
+
return {
|
|
8284
|
+
property_hash: data.property_hash,
|
|
8285
|
+
property_short_hash: shortHash(data.property_hash),
|
|
8286
|
+
property_name: data.property_name,
|
|
8287
|
+
property_description: data.property_description,
|
|
8288
|
+
property_quantity: data.property_quantity,
|
|
8289
|
+
property_unit: data.property_unit,
|
|
8290
|
+
property_amount: formatAsset(data.property_amount)
|
|
8291
|
+
};
|
|
8292
|
+
}
|
|
8293
|
+
|
|
8215
8294
|
const Factory$O = defineBuilder()({
|
|
8216
8295
|
registry_id: registry_id$M,
|
|
8217
8296
|
version: "1.0",
|
|
8218
8297
|
reads: () => ({}),
|
|
8298
|
+
// Заглушка 1.0 собирала только мету и документов в цепях не дала; модель шаблона
|
|
8299
|
+
// с версии 1.1 шире (позиция имущества, реквизиты договоров). Код версии заморожен.
|
|
8300
|
+
// @ts-expect-error модель 1.1 требует полей, которых у заглушки нет
|
|
8219
8301
|
assemble: ({ meta }) => ({ meta })
|
|
8220
8302
|
});
|
|
8303
|
+
const Factory_1_1$2 = defineBuilder()({
|
|
8304
|
+
registry_id: registry_id$M,
|
|
8305
|
+
version: "1.1",
|
|
8306
|
+
reads: ({ data, f, s }) => ({
|
|
8307
|
+
coop: () => f.getCooperative(data.coopname, data.block_num),
|
|
8308
|
+
vars: () => f.getVars(data.coopname, data.block_num),
|
|
8309
|
+
userData: () => f.getUser(data.username, data.block_num),
|
|
8310
|
+
contract: () => getBlagorostContractRef(s, data)
|
|
8311
|
+
}),
|
|
8312
|
+
assemble: ({ data, meta, reads: { coop, vars, userData, contract } }) => ({
|
|
8313
|
+
meta,
|
|
8314
|
+
coop,
|
|
8315
|
+
vars,
|
|
8316
|
+
common_user: commonUser(userData),
|
|
8317
|
+
...contract,
|
|
8318
|
+
...propertyPositionFields(data)
|
|
8319
|
+
}),
|
|
8320
|
+
signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
|
|
8321
|
+
});
|
|
8221
8322
|
|
|
8222
8323
|
const _1070_CapitalizationPropertyInvestStatement = {
|
|
8223
8324
|
__proto__: null,
|
|
8224
8325
|
Factory: Factory$O,
|
|
8326
|
+
Factory_1_1: Factory_1_1$2,
|
|
8225
8327
|
Template: CapitalizationPropertyInvestStatement
|
|
8226
8328
|
};
|
|
8227
8329
|
|
|
@@ -8229,12 +8331,38 @@ const Factory$N = defineBuilder()({
|
|
|
8229
8331
|
registry_id: registry_id$L,
|
|
8230
8332
|
version: "1.0",
|
|
8231
8333
|
reads: () => ({}),
|
|
8334
|
+
// Заглушка 1.0 собирала только мету и документов в цепях не дала; модель шаблона
|
|
8335
|
+
// с версии 1.1 шире (позиция имущества, реквизиты договоров). Код версии заморожен.
|
|
8336
|
+
// @ts-expect-error модель 1.1 требует полей, которых у заглушки нет
|
|
8232
8337
|
assemble: ({ meta }) => ({ meta })
|
|
8233
8338
|
});
|
|
8339
|
+
const Factory_1_1$1 = defineBuilder()({
|
|
8340
|
+
registry_id: registry_id$L,
|
|
8341
|
+
version: "1.1",
|
|
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
|
+
derive: ({ data, f, meta, reads: { coop } }) => ({
|
|
8349
|
+
decision: () => f.getDecision(coop, data.coopname, data.decision_id, meta.created_at, meta.timezone)
|
|
8350
|
+
}),
|
|
8351
|
+
assemble: ({ data, meta, reads: { coop, vars, userData, contract }, derived: { decision } }) => ({
|
|
8352
|
+
meta,
|
|
8353
|
+
coop,
|
|
8354
|
+
vars,
|
|
8355
|
+
decision,
|
|
8356
|
+
common_user: commonUser(userData),
|
|
8357
|
+
...contract,
|
|
8358
|
+
...propertyPositionFields(data)
|
|
8359
|
+
})
|
|
8360
|
+
});
|
|
8234
8361
|
|
|
8235
8362
|
const _1071_CapitalizationPropertyInvestDecision = {
|
|
8236
8363
|
__proto__: null,
|
|
8237
8364
|
Factory: Factory$N,
|
|
8365
|
+
Factory_1_1: Factory_1_1$1,
|
|
8238
8366
|
Template: CapitalizationPropertyInvestDecision
|
|
8239
8367
|
};
|
|
8240
8368
|
|
|
@@ -8242,12 +8370,39 @@ const Factory$M = defineBuilder()({
|
|
|
8242
8370
|
registry_id: registry_id$K,
|
|
8243
8371
|
version: "1.0",
|
|
8244
8372
|
reads: () => ({}),
|
|
8373
|
+
// Заглушка 1.0 собирала только мету и документов в цепях не дала; модель шаблона
|
|
8374
|
+
// с версии 1.1 шире (позиция имущества, реквизиты договоров). Код версии заморожен.
|
|
8375
|
+
// @ts-expect-error модель 1.1 требует полей, которых у заглушки нет
|
|
8245
8376
|
assemble: ({ meta }) => ({ meta })
|
|
8246
8377
|
});
|
|
8378
|
+
const Factory_1_1 = defineBuilder()({
|
|
8379
|
+
registry_id: registry_id$K,
|
|
8380
|
+
version: "1.1",
|
|
8381
|
+
reads: ({ data, f, s }) => ({
|
|
8382
|
+
coop: () => f.getCooperative(data.coopname, data.block_num),
|
|
8383
|
+
vars: () => f.getVars(data.coopname, data.block_num),
|
|
8384
|
+
userData: () => f.getUser(data.username, data.block_num),
|
|
8385
|
+
contract: () => getBlagorostContractRef(s, data)
|
|
8386
|
+
}),
|
|
8387
|
+
derive: ({ data, f, reads: { coop } }) => ({
|
|
8388
|
+
decision: () => f.getApprovedDecision(coop, data.coopname, data.decision_id)
|
|
8389
|
+
}),
|
|
8390
|
+
assemble: ({ data, meta, reads: { coop, vars, userData, contract }, derived: { decision } }) => ({
|
|
8391
|
+
meta,
|
|
8392
|
+
coop,
|
|
8393
|
+
vars,
|
|
8394
|
+
decision,
|
|
8395
|
+
common_user: commonUser(userData),
|
|
8396
|
+
...contract,
|
|
8397
|
+
...propertyPositionFields(data)
|
|
8398
|
+
}),
|
|
8399
|
+
signer: ({ reads: { userData } }) => commonUser(userData).full_name_or_short_name
|
|
8400
|
+
});
|
|
8247
8401
|
|
|
8248
8402
|
const _1072_CapitalizationPropertyInvestAct = {
|
|
8249
8403
|
__proto__: null,
|
|
8250
8404
|
Factory: Factory$M,
|
|
8405
|
+
Factory_1_1: Factory_1_1,
|
|
8251
8406
|
Template: CapitalizationPropertyInvestAct
|
|
8252
8407
|
};
|
|
8253
8408
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coopenomics/docs-factory",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.4.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.
|
|
53
|
+
"@coopenomics/docs-templates": "1.4.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@antfu/eslint-config": "^2.17.0",
|