@coopenomics/factory 2025.5.14 → 2025.6.13

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.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JSONSchemaType } from 'ajv';
2
- import { Cooperative } from 'cooptypes';
2
+ import { Cooperative, Interfaces, MeetContract } from 'cooptypes';
3
3
  import { InsertOneResult, Filter, UpdateResult, Document, MongoClient, Db, Collection } from 'mongodb';
4
4
 
5
5
  declare const registry_id$q = 1;
@@ -278,7 +278,13 @@ declare namespace AnnualGeneralMeetingVotingBallot {
278
278
  }
279
279
 
280
280
  declare const registry_id: 304;
281
+ /**
282
+ * Интерфейс генерации протокола решения общего собрания
283
+ */
281
284
  type Action = Cooperative.Registry.AnnualGeneralMeetingDecision.Action;
285
+ /**
286
+ * Модель данных документа
287
+ */
282
288
  type Model = Cooperative.Registry.AnnualGeneralMeetingDecision.Model;
283
289
  declare const Schema: JSONSchemaType<Model>;
284
290
  declare const Template: ITemplate<Model>;
@@ -523,6 +529,27 @@ declare const CooperativeSchema: JSONSchemaType<CooperativeData>;
523
529
 
524
530
  declare const VarsSchema: JSONSchemaType<IVars>;
525
531
 
532
+ declare const MeetSchema: JSONSchemaType<Cooperative.Model.IMeetExtended>;
533
+ declare const MeetPointSchema: JSONSchemaType<Interfaces.Meet.IMeetPoint>;
534
+ declare const QuestionSchema: JSONSchemaType<Interfaces.Meet.IQuestion>;
535
+ declare const QuestionExtendedSchema: JSONSchemaType<Cooperative.Model.IQuestionExtended>;
536
+
537
+ declare const CommonUserSchema: JSONSchemaType<Cooperative.Model.ICommonUser>;
538
+
539
+ interface IAgendaMeet {
540
+ type: 'regular' | 'extra';
541
+ open_at_datetime: string;
542
+ close_at_datetime: string;
543
+ }
544
+ interface IAgendaQuestion {
545
+ number: string;
546
+ title: string;
547
+ context?: string;
548
+ decision: string;
549
+ }
550
+ declare const AgendaMeetSchema: JSONSchemaType<IAgendaMeet>;
551
+ declare const AgendaQuestionSchema: JSONSchemaType<IAgendaQuestion>;
552
+
526
553
  interface InternalGetUserResult {
527
554
  type: string;
528
555
  data: externalDataTypes;
@@ -540,7 +567,17 @@ declare abstract class DocFactory<T extends IGenerate> {
540
567
  getVars(coopname: string, block_num?: number): Promise<IVars>;
541
568
  getRequest(_request_id: number, _block_num?: number): Promise<Cooperative.Model.ICommonRequest>;
542
569
  getProgram(_program_id: number): Promise<Cooperative.Model.ICommonProgram>;
570
+ getGeneralMeetingDecision(meet: Interfaces.Meet.IMeet, created_at: string): Promise<Cooperative.Document.IDecisionData>;
543
571
  getDecision(coop: CooperativeData, coopname: string, decision_id: number, created_at: string): Promise<Cooperative.Document.IDecisionData>;
572
+ getMeet(coopname: string, meet_hash: string, block_num?: number): Promise<Cooperative.Model.IMeetExtended>;
573
+ getMeetQuestions(coopname: string, meet_id: number, block_num?: number): Promise<Cooperative.Model.IQuestionExtended[]>;
574
+ /**
575
+ * Определяет как пользователь проголосовал по конкретному вопросу
576
+ * @param question Вопрос голосования
577
+ * @param username Имя пользователя
578
+ * @returns 'for', 'against' или 'abstained'
579
+ */
580
+ getUserVote(question: MeetContract.Tables.Questions.IOutput, username: string): 'for' | 'against' | 'abstained';
544
581
  getTemplate<T>(scope: string, registry_id: number, block_num?: number): Promise<ITemplate<T>>;
545
582
  generatePDF(data: externalDataTypes | string, context: string, vars: ICombinedData, translation: ITranslations, meta: IMetaDocument, skip_save?: boolean): Promise<IGeneratedDocument>;
546
583
  getFullName(data: externalDataTypes | string): string;
@@ -599,4 +636,4 @@ declare class Generator implements IGenerator {
599
636
  constructCooperative(username: string, block_num?: number): Promise<CooperativeData | null>;
600
637
  }
601
638
 
602
- export { AnnualGeneralMeetingAgenda, AnnualGeneralMeetingDecision, AnnualGeneralMeetingNotification, AnnualGeneralMeetingSovietDecision, AnnualGeneralMeetingVotingBallot, AssetContributionAct, AssetContributionDecision, AssetContributionStatement, BankAccountSchema, CoopenomicsAgreement, CooperativeSchema, type Currency, DecisionOfParticipantApplication, FreeDecision, Generator, type IBCState, type IBankAccount, type ICombinedData, type CooperativeData as ICooperativeData, type ExternalEntrepreneurData as IEntrepreneurData, type ExternalProjectData as IExternalProjectData, type IFilterActions, type IFilterDeltas, type IFilterDocuments, type IGenerate, type IGeneratedDocument, type IGenerationOptions, type IGenerator, type ExternalIndividualData as IIndividualData, type IMetaDocument, type IMetaDocumentPartial, type ExternalOrganizationData as IOrganizationData, type IPaymentData, type ITemplate, type ITranslations, InvestByMoneyStatement, InvestByResultAct, InvestByResultStatement, InvestMembershipConvertation, InvestmentAgreement, type LangType, type NestedRecord, type Numbers, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, ReturnByAssetAct, ReturnByAssetDecision, ReturnByAssetStatement, SelectBranchStatement, SosediAgreement, UserAgreement, VarsSchema, WalletAgreement, type dataTypes, decisionSchema, entrepreneurSchema, type externalDataTypes, type externalDataTypesArrays, individualSchema, type internalFilterTypes, organizationSchema, paymentMethodSchema };
639
+ export { AgendaMeetSchema, AgendaQuestionSchema, AnnualGeneralMeetingAgenda, AnnualGeneralMeetingDecision, AnnualGeneralMeetingNotification, AnnualGeneralMeetingSovietDecision, AnnualGeneralMeetingVotingBallot, AssetContributionAct, AssetContributionDecision, AssetContributionStatement, BankAccountSchema, CommonUserSchema, CoopenomicsAgreement, CooperativeSchema, type Currency, DecisionOfParticipantApplication, FreeDecision, Generator, type IBCState, type IBankAccount, type ICombinedData, type CooperativeData as ICooperativeData, type ExternalEntrepreneurData as IEntrepreneurData, type ExternalProjectData as IExternalProjectData, type IFilterActions, type IFilterDeltas, type IFilterDocuments, type IGenerate, type IGeneratedDocument, type IGenerationOptions, type IGenerator, type ExternalIndividualData as IIndividualData, type IMetaDocument, type IMetaDocumentPartial, type ExternalOrganizationData as IOrganizationData, type IPaymentData, type ITemplate, type ITranslations, InvestByMoneyStatement, InvestByResultAct, InvestByResultStatement, InvestMembershipConvertation, InvestmentAgreement, type LangType, MeetPointSchema, MeetSchema, type NestedRecord, type Numbers, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, QuestionExtendedSchema, QuestionSchema, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, ReturnByAssetAct, ReturnByAssetDecision, ReturnByAssetStatement, SelectBranchStatement, SosediAgreement, UserAgreement, VarsSchema, WalletAgreement, type dataTypes, decisionSchema, entrepreneurSchema, type externalDataTypes, type externalDataTypesArrays, individualSchema, type internalFilterTypes, organizationSchema, paymentMethodSchema };
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JSONSchemaType } from 'ajv';
2
- import { Cooperative } from 'cooptypes';
2
+ import { Cooperative, Interfaces, MeetContract } from 'cooptypes';
3
3
  import { InsertOneResult, Filter, UpdateResult, Document, MongoClient, Db, Collection } from 'mongodb';
4
4
 
5
5
  declare const registry_id$q = 1;
@@ -278,7 +278,13 @@ declare namespace AnnualGeneralMeetingVotingBallot {
278
278
  }
279
279
 
280
280
  declare const registry_id: 304;
281
+ /**
282
+ * Интерфейс генерации протокола решения общего собрания
283
+ */
281
284
  type Action = Cooperative.Registry.AnnualGeneralMeetingDecision.Action;
285
+ /**
286
+ * Модель данных документа
287
+ */
282
288
  type Model = Cooperative.Registry.AnnualGeneralMeetingDecision.Model;
283
289
  declare const Schema: JSONSchemaType<Model>;
284
290
  declare const Template: ITemplate<Model>;
@@ -523,6 +529,27 @@ declare const CooperativeSchema: JSONSchemaType<CooperativeData>;
523
529
 
524
530
  declare const VarsSchema: JSONSchemaType<IVars>;
525
531
 
532
+ declare const MeetSchema: JSONSchemaType<Cooperative.Model.IMeetExtended>;
533
+ declare const MeetPointSchema: JSONSchemaType<Interfaces.Meet.IMeetPoint>;
534
+ declare const QuestionSchema: JSONSchemaType<Interfaces.Meet.IQuestion>;
535
+ declare const QuestionExtendedSchema: JSONSchemaType<Cooperative.Model.IQuestionExtended>;
536
+
537
+ declare const CommonUserSchema: JSONSchemaType<Cooperative.Model.ICommonUser>;
538
+
539
+ interface IAgendaMeet {
540
+ type: 'regular' | 'extra';
541
+ open_at_datetime: string;
542
+ close_at_datetime: string;
543
+ }
544
+ interface IAgendaQuestion {
545
+ number: string;
546
+ title: string;
547
+ context?: string;
548
+ decision: string;
549
+ }
550
+ declare const AgendaMeetSchema: JSONSchemaType<IAgendaMeet>;
551
+ declare const AgendaQuestionSchema: JSONSchemaType<IAgendaQuestion>;
552
+
526
553
  interface InternalGetUserResult {
527
554
  type: string;
528
555
  data: externalDataTypes;
@@ -540,7 +567,17 @@ declare abstract class DocFactory<T extends IGenerate> {
540
567
  getVars(coopname: string, block_num?: number): Promise<IVars>;
541
568
  getRequest(_request_id: number, _block_num?: number): Promise<Cooperative.Model.ICommonRequest>;
542
569
  getProgram(_program_id: number): Promise<Cooperative.Model.ICommonProgram>;
570
+ getGeneralMeetingDecision(meet: Interfaces.Meet.IMeet, created_at: string): Promise<Cooperative.Document.IDecisionData>;
543
571
  getDecision(coop: CooperativeData, coopname: string, decision_id: number, created_at: string): Promise<Cooperative.Document.IDecisionData>;
572
+ getMeet(coopname: string, meet_hash: string, block_num?: number): Promise<Cooperative.Model.IMeetExtended>;
573
+ getMeetQuestions(coopname: string, meet_id: number, block_num?: number): Promise<Cooperative.Model.IQuestionExtended[]>;
574
+ /**
575
+ * Определяет как пользователь проголосовал по конкретному вопросу
576
+ * @param question Вопрос голосования
577
+ * @param username Имя пользователя
578
+ * @returns 'for', 'against' или 'abstained'
579
+ */
580
+ getUserVote(question: MeetContract.Tables.Questions.IOutput, username: string): 'for' | 'against' | 'abstained';
544
581
  getTemplate<T>(scope: string, registry_id: number, block_num?: number): Promise<ITemplate<T>>;
545
582
  generatePDF(data: externalDataTypes | string, context: string, vars: ICombinedData, translation: ITranslations, meta: IMetaDocument, skip_save?: boolean): Promise<IGeneratedDocument>;
546
583
  getFullName(data: externalDataTypes | string): string;
@@ -599,4 +636,4 @@ declare class Generator implements IGenerator {
599
636
  constructCooperative(username: string, block_num?: number): Promise<CooperativeData | null>;
600
637
  }
601
638
 
602
- export { AnnualGeneralMeetingAgenda, AnnualGeneralMeetingDecision, AnnualGeneralMeetingNotification, AnnualGeneralMeetingSovietDecision, AnnualGeneralMeetingVotingBallot, AssetContributionAct, AssetContributionDecision, AssetContributionStatement, BankAccountSchema, CoopenomicsAgreement, CooperativeSchema, type Currency, DecisionOfParticipantApplication, FreeDecision, Generator, type IBCState, type IBankAccount, type ICombinedData, type CooperativeData as ICooperativeData, type ExternalEntrepreneurData as IEntrepreneurData, type ExternalProjectData as IExternalProjectData, type IFilterActions, type IFilterDeltas, type IFilterDocuments, type IGenerate, type IGeneratedDocument, type IGenerationOptions, type IGenerator, type ExternalIndividualData as IIndividualData, type IMetaDocument, type IMetaDocumentPartial, type ExternalOrganizationData as IOrganizationData, type IPaymentData, type ITemplate, type ITranslations, InvestByMoneyStatement, InvestByResultAct, InvestByResultStatement, InvestMembershipConvertation, InvestmentAgreement, type LangType, type NestedRecord, type Numbers, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, ReturnByAssetAct, ReturnByAssetDecision, ReturnByAssetStatement, SelectBranchStatement, SosediAgreement, UserAgreement, VarsSchema, WalletAgreement, type dataTypes, decisionSchema, entrepreneurSchema, type externalDataTypes, type externalDataTypesArrays, individualSchema, type internalFilterTypes, organizationSchema, paymentMethodSchema };
639
+ export { AgendaMeetSchema, AgendaQuestionSchema, AnnualGeneralMeetingAgenda, AnnualGeneralMeetingDecision, AnnualGeneralMeetingNotification, AnnualGeneralMeetingSovietDecision, AnnualGeneralMeetingVotingBallot, AssetContributionAct, AssetContributionDecision, AssetContributionStatement, BankAccountSchema, CommonUserSchema, CoopenomicsAgreement, CooperativeSchema, type Currency, DecisionOfParticipantApplication, FreeDecision, Generator, type IBCState, type IBankAccount, type ICombinedData, type CooperativeData as ICooperativeData, type ExternalEntrepreneurData as IEntrepreneurData, type ExternalProjectData as IExternalProjectData, type IFilterActions, type IFilterDeltas, type IFilterDocuments, type IGenerate, type IGeneratedDocument, type IGenerationOptions, type IGenerator, type ExternalIndividualData as IIndividualData, type IMetaDocument, type IMetaDocumentPartial, type ExternalOrganizationData as IOrganizationData, type IPaymentData, type ITemplate, type ITranslations, InvestByMoneyStatement, InvestByResultAct, InvestByResultStatement, InvestMembershipConvertation, InvestmentAgreement, type LangType, MeetPointSchema, MeetSchema, type NestedRecord, type Numbers, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, QuestionExtendedSchema, QuestionSchema, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, ReturnByAssetAct, ReturnByAssetDecision, ReturnByAssetStatement, SelectBranchStatement, SosediAgreement, UserAgreement, VarsSchema, WalletAgreement, type dataTypes, decisionSchema, entrepreneurSchema, type externalDataTypes, type externalDataTypesArrays, individualSchema, type internalFilterTypes, organizationSchema, paymentMethodSchema };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { JSONSchemaType } from 'ajv';
2
- import { Cooperative } from 'cooptypes';
2
+ import { Cooperative, Interfaces, MeetContract } from 'cooptypes';
3
3
  import { InsertOneResult, Filter, UpdateResult, Document, MongoClient, Db, Collection } from 'mongodb';
4
4
 
5
5
  declare const registry_id$q = 1;
@@ -278,7 +278,13 @@ declare namespace AnnualGeneralMeetingVotingBallot {
278
278
  }
279
279
 
280
280
  declare const registry_id: 304;
281
+ /**
282
+ * Интерфейс генерации протокола решения общего собрания
283
+ */
281
284
  type Action = Cooperative.Registry.AnnualGeneralMeetingDecision.Action;
285
+ /**
286
+ * Модель данных документа
287
+ */
282
288
  type Model = Cooperative.Registry.AnnualGeneralMeetingDecision.Model;
283
289
  declare const Schema: JSONSchemaType<Model>;
284
290
  declare const Template: ITemplate<Model>;
@@ -523,6 +529,27 @@ declare const CooperativeSchema: JSONSchemaType<CooperativeData>;
523
529
 
524
530
  declare const VarsSchema: JSONSchemaType<IVars>;
525
531
 
532
+ declare const MeetSchema: JSONSchemaType<Cooperative.Model.IMeetExtended>;
533
+ declare const MeetPointSchema: JSONSchemaType<Interfaces.Meet.IMeetPoint>;
534
+ declare const QuestionSchema: JSONSchemaType<Interfaces.Meet.IQuestion>;
535
+ declare const QuestionExtendedSchema: JSONSchemaType<Cooperative.Model.IQuestionExtended>;
536
+
537
+ declare const CommonUserSchema: JSONSchemaType<Cooperative.Model.ICommonUser>;
538
+
539
+ interface IAgendaMeet {
540
+ type: 'regular' | 'extra';
541
+ open_at_datetime: string;
542
+ close_at_datetime: string;
543
+ }
544
+ interface IAgendaQuestion {
545
+ number: string;
546
+ title: string;
547
+ context?: string;
548
+ decision: string;
549
+ }
550
+ declare const AgendaMeetSchema: JSONSchemaType<IAgendaMeet>;
551
+ declare const AgendaQuestionSchema: JSONSchemaType<IAgendaQuestion>;
552
+
526
553
  interface InternalGetUserResult {
527
554
  type: string;
528
555
  data: externalDataTypes;
@@ -540,7 +567,17 @@ declare abstract class DocFactory<T extends IGenerate> {
540
567
  getVars(coopname: string, block_num?: number): Promise<IVars>;
541
568
  getRequest(_request_id: number, _block_num?: number): Promise<Cooperative.Model.ICommonRequest>;
542
569
  getProgram(_program_id: number): Promise<Cooperative.Model.ICommonProgram>;
570
+ getGeneralMeetingDecision(meet: Interfaces.Meet.IMeet, created_at: string): Promise<Cooperative.Document.IDecisionData>;
543
571
  getDecision(coop: CooperativeData, coopname: string, decision_id: number, created_at: string): Promise<Cooperative.Document.IDecisionData>;
572
+ getMeet(coopname: string, meet_hash: string, block_num?: number): Promise<Cooperative.Model.IMeetExtended>;
573
+ getMeetQuestions(coopname: string, meet_id: number, block_num?: number): Promise<Cooperative.Model.IQuestionExtended[]>;
574
+ /**
575
+ * Определяет как пользователь проголосовал по конкретному вопросу
576
+ * @param question Вопрос голосования
577
+ * @param username Имя пользователя
578
+ * @returns 'for', 'against' или 'abstained'
579
+ */
580
+ getUserVote(question: MeetContract.Tables.Questions.IOutput, username: string): 'for' | 'against' | 'abstained';
544
581
  getTemplate<T>(scope: string, registry_id: number, block_num?: number): Promise<ITemplate<T>>;
545
582
  generatePDF(data: externalDataTypes | string, context: string, vars: ICombinedData, translation: ITranslations, meta: IMetaDocument, skip_save?: boolean): Promise<IGeneratedDocument>;
546
583
  getFullName(data: externalDataTypes | string): string;
@@ -599,4 +636,4 @@ declare class Generator implements IGenerator {
599
636
  constructCooperative(username: string, block_num?: number): Promise<CooperativeData | null>;
600
637
  }
601
638
 
602
- export { AnnualGeneralMeetingAgenda, AnnualGeneralMeetingDecision, AnnualGeneralMeetingNotification, AnnualGeneralMeetingSovietDecision, AnnualGeneralMeetingVotingBallot, AssetContributionAct, AssetContributionDecision, AssetContributionStatement, BankAccountSchema, CoopenomicsAgreement, CooperativeSchema, type Currency, DecisionOfParticipantApplication, FreeDecision, Generator, type IBCState, type IBankAccount, type ICombinedData, type CooperativeData as ICooperativeData, type ExternalEntrepreneurData as IEntrepreneurData, type ExternalProjectData as IExternalProjectData, type IFilterActions, type IFilterDeltas, type IFilterDocuments, type IGenerate, type IGeneratedDocument, type IGenerationOptions, type IGenerator, type ExternalIndividualData as IIndividualData, type IMetaDocument, type IMetaDocumentPartial, type ExternalOrganizationData as IOrganizationData, type IPaymentData, type ITemplate, type ITranslations, InvestByMoneyStatement, InvestByResultAct, InvestByResultStatement, InvestMembershipConvertation, InvestmentAgreement, type LangType, type NestedRecord, type Numbers, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, ReturnByAssetAct, ReturnByAssetDecision, ReturnByAssetStatement, SelectBranchStatement, SosediAgreement, UserAgreement, VarsSchema, WalletAgreement, type dataTypes, decisionSchema, entrepreneurSchema, type externalDataTypes, type externalDataTypesArrays, individualSchema, type internalFilterTypes, organizationSchema, paymentMethodSchema };
639
+ export { AgendaMeetSchema, AgendaQuestionSchema, AnnualGeneralMeetingAgenda, AnnualGeneralMeetingDecision, AnnualGeneralMeetingNotification, AnnualGeneralMeetingSovietDecision, AnnualGeneralMeetingVotingBallot, AssetContributionAct, AssetContributionDecision, AssetContributionStatement, BankAccountSchema, CommonUserSchema, CoopenomicsAgreement, CooperativeSchema, type Currency, DecisionOfParticipantApplication, FreeDecision, Generator, type IBCState, type IBankAccount, type ICombinedData, type CooperativeData as ICooperativeData, type ExternalEntrepreneurData as IEntrepreneurData, type ExternalProjectData as IExternalProjectData, type IFilterActions, type IFilterDeltas, type IFilterDocuments, type IGenerate, type IGeneratedDocument, type IGenerationOptions, type IGenerator, type ExternalIndividualData as IIndividualData, type IMetaDocument, type IMetaDocumentPartial, type ExternalOrganizationData as IOrganizationData, type IPaymentData, type ITemplate, type ITranslations, InvestByMoneyStatement, InvestByResultAct, InvestByResultStatement, InvestMembershipConvertation, InvestmentAgreement, type LangType, MeetPointSchema, MeetSchema, type NestedRecord, type Numbers, ParticipantApplication, PrivacyPolicy, ProjectFreeDecision, QuestionExtendedSchema, QuestionSchema, Registry, RegulationElectronicSignaturet as RegulationElectronicSignature, ReturnByAssetAct, ReturnByAssetDecision, ReturnByAssetStatement, SelectBranchStatement, SosediAgreement, UserAgreement, VarsSchema, WalletAgreement, type dataTypes, decisionSchema, entrepreneurSchema, type externalDataTypes, type externalDataTypesArrays, individualSchema, type internalFilterTypes, organizationSchema, paymentMethodSchema };