Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DDCORE-8810 Поддержка работы с сертом ЮЛ/ИП + МЧД. Изменения в api #1176

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions proto/PowersOfAttorney/PowerOfAttorney.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ message PowerOfAttorney {
repeated PowerOfAttorney DelegationChain = 8;
required PowerOfAttorneyPermissionsInfo PermissionsInfo = 9;
optional PowerOfAttorneyDelegationInfo DelegationInfo = 10;
repeated PowerOfAttorneyRepresentative Representatives = 11;
}

message PowerOfAttorneyIssuer {
Expand Down Expand Up @@ -155,3 +156,44 @@ message PowerOfAttorneyContentV2 {
required bytes Signature = 2;
required PowerOfAttorneyFullId FullId = 3;
}

message PowerOfAttorneyRepresentative {
optional PowerOfAttorneyRepresentativeType Type = 1;
optional PowerOfAttorneyRepresentativeLegalEntity LegalEntity = 2;
optional PowerOfAttorneyRepresentativeIndividualEntrepreneurEntity IndividualEntrepreneur = 3;
optional PowerOfAttorneyRepresentativePhysicalEntity PhysicalEntity = 4;
optional PowerOfAttorneyRepresentativeLegalEntity LegalEntitySubsidiary = 5;
optional PowerOfAttorneyRepresentativeForeignLegalSubsidiaryEntity ForeignLegalEntitySubsidiary = 6;
}

enum PowerOfAttorneyRepresentativeType {
UnknownRepresentativeType = 0;
RepresentativeLegalEntity = 1;
RepresentativeIndividualEntrepreneurEntity = 2;
RepresentativePhysicalEntity = 3;
RepresentativeLegalEntitySubsidiary = 4;
RepresentativeForeignLegalEntitySubsidiary = 5;
}

message PowerOfAttorneyRepresentativeLegalEntity {
optional string Inn = 1;
required string Kpp = 2;
required string OrganizationName = 3;
repeated PowerOfAttorneyRepresentativePhysicalEntity PhysicalEntity = 4;
}

message PowerOfAttorneyRepresentativeIndividualEntrepreneurEntity {
required string Inn = 1;
required string OrganizationName = 2;
}

message PowerOfAttorneyRepresentativePhysicalEntity {
optional string Inn = 1;
required FullName PersonName = 2;
}

message PowerOfAttorneyRepresentativeForeignLegalSubsidiaryEntity {
optional string Inn = 1;
optional string Kpp = 2;
required string OrganizationName = 3;
}
182 changes: 133 additions & 49 deletions src/Com/PowersOfAttorney.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public interface IPowerOfAttorney
ReadonlyList DelegationChainList { get; }
PowerOfAttorneyPermissionsInfo PermissionsInfo { get; set; }
PowerOfAttorneyDelegationInfo DelegationInfo { get; set; }
ReadonlyList RepresentativesList { get; }
}

[ComVisible(true)]
Expand All @@ -46,14 +47,110 @@ public interface IPowerOfAttorney
[ComDefaultInterface(typeof(IPowerOfAttorney))]
public partial class PowerOfAttorney : SafeComObject, IPowerOfAttorney
{
public ReadonlyList DelegationChainList
public ReadonlyList DelegationChainList => new ReadonlyList(DelegationChain);
public ReadonlyList RepresentativesList => new ReadonlyList(Representatives);
}

[ComVisible(true)]
[Guid("C8A6DB43-EB31-480B-9515-FC7E6AB4AFB3")]
public interface IPowerOfAttorneyRepresentative
{
Com.PowerOfAttorneyRepresentativeType Type { get; set; }
PowerOfAttorneyRepresentativeLegalEntity LegalEntity { get; set; }
PowerOfAttorneyRepresentativeIndividualEntrepreneurEntity IndividualEntrepreneur { get; set; }
PowerOfAttorneyRepresentativePhysicalEntity PhysicalEntity { get; set; }
PowerOfAttorneyRepresentativeLegalEntity LegalEntitySubsidiary { get; set; }
PowerOfAttorneyRepresentativeForeignLegalSubsidiaryEntity ForeignLegalEntitySubsidiary { get; set; }
}

[ComVisible(true)]
[ProgId("Diadoc.Api.PowerOfAttorneyRepresentative")]
[Guid("85C4946B-CEB6-47D5-9D64-EA7EDE3C1330")]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(IPowerOfAttorneyRepresentative))]
public partial class PowerOfAttorneyRepresentative : SafeComObject, IPowerOfAttorneyRepresentative
{
Com.PowerOfAttorneyRepresentativeType IPowerOfAttorneyRepresentative.Type
{
get { return new ReadonlyList(DelegationChain); }
get => (Com.PowerOfAttorneyRepresentativeType) Type;
set => Type = (PowerOfAttorneyRepresentativeType) value;
}
}

[ComVisible(true)]
[Guid("55DFF897-C2FE-4A71-ADC2-7907C2190750")]
[Guid("24282D30-965C-4E33-B48A-EC234D2AEDD3")]
public interface IPowerOfAttorneyRepresentativeLegalEntity
{
string Inn { get; set; }
string Kpp { get; set; }
string OrganizationName { get; set; }
ReadonlyList PhysicalEntities { get; }
}

[ComVisible(true)]
[ProgId("Diadoc.Api.PowerOfAttorneyRepresentativeLegalEntity")]
[Guid("324CF76F-78C7-4CA2-A985-676C9890C198")]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(IPowerOfAttorneyRepresentativeLegalEntity))]
public partial class PowerOfAttorneyRepresentativeLegalEntity : SafeComObject, IPowerOfAttorneyRepresentativeLegalEntity
{
public ReadonlyList PhysicalEntities => new ReadonlyList(PhysicalEntity);
}

[ComVisible(true)]
[Guid("76FBD853-9519-4BD6-A788-5B914F4168BB")]
public interface IPowerOfAttorneyRepresentativeIndividualEntrepreneurEntity
{
string Inn { get; set; }
string OrganizationName { get; set; }
}

[ComVisible(true)]
[ProgId("Diadoc.Api.PowerOfAttorneyRepresentativeIndividualEntrepreneurEntity")]
[Guid("EB4BCB26-4AFB-4030-9659-C1A9458A40C4")]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(IPowerOfAttorneyRepresentativeIndividualEntrepreneurEntity))]
public partial class PowerOfAttorneyRepresentativeIndividualEntrepreneurEntity : SafeComObject, IPowerOfAttorneyRepresentativeIndividualEntrepreneurEntity
{
}

[ComVisible(true)]
[Guid("A249CB40-62FC-4674-9D09-221C37325742")]
public interface IPowerOfAttorneyRepresentativePhysicalEntity
{
string Inn { get; set; }
FullName PersonName { get; set; }
}

[ComVisible(true)]
[ProgId("Diadoc.Api.IPowerOfAttorneyRepresentativePhysicalEntity")]
[Guid("C6D795EB-936A-422F-9F04-135D616B507B")]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(IPowerOfAttorneyRepresentativePhysicalEntity))]
public partial class PowerOfAttorneyRepresentativePhysicalEntity : SafeComObject, IPowerOfAttorneyRepresentativePhysicalEntity
{
}

[ComVisible(true)]
[Guid("1E1F4224-B22C-4A29-87FD-B0F63CEBF8B4")]
public interface IPowerOfAttorneyRepresentativeForeignLegalSubsidiaryEntity
{
string Inn { get; set; }
string Kpp { get; set; }
string OrganizationName { get; set; }
}

[ComVisible(true)]
[ProgId("Diadoc.Api.PowerOfAttorneyRepresentativeForeignLegalSubsidiaryEntity")]
[Guid("03A0A8F3-C18A-4922-A781-71355AB7A3F0")]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(IPowerOfAttorneyRepresentativeForeignLegalSubsidiaryEntity))]
public partial class PowerOfAttorneyRepresentativeForeignLegalSubsidiaryEntity : SafeComObject, IPowerOfAttorneyRepresentativeForeignLegalSubsidiaryEntity
{
}

[ComVisible(true)]
[Guid("9098DB49-90C1-44E4-A116-EADB9DA3B124")]
public interface IPowerOfAttorneyIssuer
{
Com.PowerOfAttorneyIssuerType Type { get; set; }
Expand All @@ -72,8 +169,8 @@ public partial class PowerOfAttorneyIssuer : SafeComObject, IPowerOfAttorneyIssu
{
Com.PowerOfAttorneyIssuerType IPowerOfAttorneyIssuer.Type
{
get { return (Com.PowerOfAttorneyIssuerType) Type; }
set { Type = (PowerOfAttorneyIssuerType) value; }
get => (Com.PowerOfAttorneyIssuerType) Type;
set => Type = (PowerOfAttorneyIssuerType) value;
}
}

Expand Down Expand Up @@ -249,18 +346,15 @@ public interface IValidationProtocol
{
ReadonlyList CheckResultsList { get; }
}

[ComVisible(true)]
[ProgId("Diadoc.Api.ValidationProtocol")]
[Guid("ECE41E66-4BFC-4C96-BB3A-AF7D9734927B")]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(IValidationProtocol))]
public partial class ValidationProtocol : SafeComObject, IValidationProtocol
{
public ReadonlyList CheckResultsList
{
get { return new ReadonlyList(CheckResults); }
}
public ReadonlyList CheckResultsList => new ReadonlyList(CheckResults);
}

[ComVisible(true)]
Expand All @@ -270,8 +364,9 @@ public interface IPowerOfAttorneyValidationStatus
Com.Severity Severity { get; }
Com.PowerOfAttorneyValidationStatusNamedId StatusNamedId { get; }
string StatusText { get; }
[Obsolete]
ReadonlyList ErrorsList { get; }

[Obsolete] ReadonlyList ErrorsList { get; }

ValidationProtocol ValidationProtocol { get; }
PowerOfAttorneyValidationError OperationError { get; }
}
Expand All @@ -283,20 +378,11 @@ public interface IPowerOfAttorneyValidationStatus
[ComDefaultInterface(typeof(IPowerOfAttorneyValidationStatus))]
public partial class PowerOfAttorneyValidationStatus : SafeComObject, IPowerOfAttorneyValidationStatus
{
Com.Severity IPowerOfAttorneyValidationStatus.Severity
{
get { return (Com.Severity) Severity; }
}
Com.Severity IPowerOfAttorneyValidationStatus.Severity => (Com.Severity) Severity;

Com.PowerOfAttorneyValidationStatusNamedId IPowerOfAttorneyValidationStatus.StatusNamedId
{
get { return (Com.PowerOfAttorneyValidationStatusNamedId) StatusNamedId; }
}
Com.PowerOfAttorneyValidationStatusNamedId IPowerOfAttorneyValidationStatus.StatusNamedId => (Com.PowerOfAttorneyValidationStatusNamedId) StatusNamedId;

public ReadonlyList ErrorsList
{
get { return new ReadonlyList(Errors); }
}
public ReadonlyList ErrorsList => new ReadonlyList(Errors);
}

[ComVisible(true)]
Expand All @@ -315,28 +401,25 @@ public interface IPowerOfAttorneyValidationError
public partial class PowerOfAttorneyValidationError : SafeComObject, IPowerOfAttorneyValidationError
{
}

[ComVisible(true)]
[Guid("AC2185A0-5D6D-4371-A487-A75EC0627897")]
public interface IValidationCheckResult
{
Com.PowerOfAttorneyValidationCheckStatus Status { get; }
string Name { get; }

PowerOfAttorneyValidationError Error { get; }
}

[ComVisible(true)]
[ProgId("Diadoc.Api.ValidationCheckResult")]
[Guid("04838F25-EFC4-4ACD-9789-731F07CAA1C9")]
[ClassInterface(ClassInterfaceType.None)]
[ComDefaultInterface(typeof(IValidationCheckResult))]
public partial class ValidationCheckResult : SafeComObject, IValidationCheckResult
{
Com.PowerOfAttorneyValidationCheckStatus IValidationCheckResult.Status
{
get { return (Com.PowerOfAttorneyValidationCheckStatus) Status; }
}
Com.PowerOfAttorneyValidationCheckStatus IValidationCheckResult.Status => (Com.PowerOfAttorneyValidationCheckStatus) Status;
}

[ComVisible(true)]
Expand Down Expand Up @@ -414,10 +497,7 @@ public interface IPowerOfAttorneyRegisterResult
[ComDefaultInterface(typeof(IPowerOfAttorneyRegisterResult))]
public partial class PowerOfAttorneyRegisterResult : SafeComObject, IPowerOfAttorneyRegisterResult
{
public ReadonlyList ErrorsList
{
get { return new ReadonlyList(Errors); }
}
public ReadonlyList ErrorsList => new ReadonlyList(Errors);
}

[ComVisible(true)]
Expand Down Expand Up @@ -524,10 +604,7 @@ public interface IPowerOfAttorneyPermissionsInfo
[ComDefaultInterface(typeof(IPowerOfAttorneyPermissionsInfo))]
public partial class PowerOfAttorneyPermissionsInfo : SafeComObject, IPowerOfAttorneyPermissionsInfo
{
public ReadonlyList PermissionsList
{
get { return new ReadonlyList(Permissions); }
}
public ReadonlyList PermissionsList => new ReadonlyList(Permissions);
}

[ComVisible(true)]
Expand All @@ -546,10 +623,7 @@ public interface IPowerOfAttorneyPermissions
[ComDefaultInterface(typeof(IPowerOfAttorneyPermissions))]
public partial class PowerOfAttorneyPermissions : SafeComObject, IPowerOfAttorneyPermissions
{
public ReadonlyList MachineReadablePermissionList
{
get { return new ReadonlyList(MachineReadablePermission); }
}
public ReadonlyList MachineReadablePermissionList => new ReadonlyList(MachineReadablePermission);
}

[ComVisible(true)]
Expand All @@ -569,10 +643,7 @@ public interface IPowerOfAttorneyMachineReadablePermission
[ComDefaultInterface(typeof(IPowerOfAttorneyMachineReadablePermission))]
public partial class PowerOfAttorneyMachineReadablePermission : SafeComObject, IPowerOfAttorneyMachineReadablePermission
{
public ReadonlyList RestrictionsList
{
get { return new ReadonlyList(Restrictions); }
}
public ReadonlyList RestrictionsList => new ReadonlyList(Restrictions);
}

[ComVisible(true)]
Expand All @@ -595,7 +666,7 @@ public interface IPowerOfAttorneyRestrictions
public partial class PowerOfAttorneyRestrictions : SafeComObject, IPowerOfAttorneyRestrictions
{
}

[ComVisible(true)]
[Guid("D7F0A026-1580-480E-934F-89C90DF677FB")]
public interface IPowerOfAttorneyDelegationInfo
Expand All @@ -604,7 +675,7 @@ public interface IPowerOfAttorneyDelegationInfo
string ParentRegistrationNumber { get; set; }
ReadonlyList RootIssuersList { get; }
}

[ComVisible(true)]
[ProgId("Diadoc.Api.PowerOfAttorneyDelegationInfo")]
[Guid("2B4977C2-30AA-45F1-AFC3-032E6E751F4C")]
Expand Down Expand Up @@ -634,6 +705,19 @@ public enum PowerOfAttorneyIssuerType
PhysicalEntity = 4
}

[ComVisible(true)]
[Guid("D8F15E75-17BC-4154-8DD5-AB1EFCAC9A0B")]
[XmlType(TypeName = "PowerOfAttorneyRepresentativeType", Namespace = "https://diadoc-api.kontur.ru")]
public enum PowerOfAttorneyRepresentativeType
{
UnknownRepresentativeType = 0,
RepresentativeLegalEntity = 1,
RepresentativeIndividualEntrepreneurEntity = 2,
RepresentativePhysicalEntity = 3,
RepresentativeLegalEntitySubsidiary = 4,
RepresentativeForeignLegalEntitySubsidiary = 5
}

[ComVisible(true)]
[Guid("FF262C58-A262-480B-B928-BE3BDCEE5D8B")]
//NOTE: Это хотели, чтобы можно было использовать XML-сериализацию для классов
Expand Down
Loading