Skip to content

Commit 6f14e36

Browse files
author
and.av
committed
DDCORE-10318 add new data fields in msk time zone in poa model
1 parent 07b64e5 commit 6f14e36

File tree

5 files changed

+83
-0
lines changed

5 files changed

+83
-0
lines changed

proto/DateTimeOffsetDto.proto

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package Diadoc.Api.Proto;
2+
3+
message DateTimeOffsetDto
4+
{
5+
required sfixed64 UtcTicks = 1;
6+
required sfixed64 OffsetTicks = 2;
7+
}

proto/PowersOfAttorney/PowerOfAttorney.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import "Content_v3.proto";
22
import "Timestamp.proto";
33
import "User.proto";
4+
import "DateTimeOffsetDto.proto";
45

56
package Diadoc.Api.Proto.PowersOfAttorney;
67

@@ -22,6 +23,8 @@ message PowerOfAttorney {
2223
required PowerOfAttorneyPermissionsInfo PermissionsInfo = 9;
2324
optional PowerOfAttorneyDelegationInfo DelegationInfo = 10;
2425
repeated PowerOfAttorneyRepresentative Representatives = 11;
26+
required DateTimeOffsetDto StartAtByMoscow = 12;
27+
required DateTimeOffsetDto ExpireAtByMoscow = 13;
2528
}
2629

2730
message PowerOfAttorneyIssuer {

src/Proto/DateTimeOffsetDto.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
3+
namespace Diadoc.Api.Proto
4+
{
5+
public partial class DateTimeOffsetDto
6+
{
7+
public DateTimeOffset ToDateTimeOffset()
8+
{
9+
return new DateTimeOffset(UtcTicks, TimeSpan.Zero).ToOffset(TimeSpan.FromTicks(OffsetTicks));
10+
}
11+
12+
public static explicit operator DateTimeOffset(DateTimeOffsetDto value) => value.ToDateTimeOffset();
13+
14+
public static explicit operator DateTimeOffsetDto(DateTimeOffset value)
15+
=> new DateTimeOffsetDto
16+
{
17+
UtcTicks = value.UtcTicks,
18+
OffsetTicks = value.Offset.Ticks
19+
};
20+
}
21+
}

src/Proto/DateTimeOffsetDto.proto.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//------------------------------------------------------------------------------
2+
// <auto-generated>
3+
// This code was generated by a tool.
4+
//
5+
// Changes to this file may cause incorrect behavior and will be lost if
6+
// the code is regenerated.
7+
// </auto-generated>
8+
//------------------------------------------------------------------------------
9+
10+
// Generated from: DateTimeOffsetDto.proto
11+
namespace Diadoc.Api.Proto
12+
{
13+
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"DateTimeOffsetDto")]
14+
public partial class DateTimeOffsetDto : global::ProtoBuf.IExtensible
15+
{
16+
public DateTimeOffsetDto() {}
17+
18+
private long _UtcTicks;
19+
[global::ProtoBuf.ProtoMember(1, IsRequired = true, Name=@"UtcTicks", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
20+
public long UtcTicks
21+
{
22+
get { return _UtcTicks; }
23+
set { _UtcTicks = value; }
24+
}
25+
private long _OffsetTicks;
26+
[global::ProtoBuf.ProtoMember(2, IsRequired = true, Name=@"OffsetTicks", DataFormat = global::ProtoBuf.DataFormat.FixedSize)]
27+
public long OffsetTicks
28+
{
29+
get { return _OffsetTicks; }
30+
set { _OffsetTicks = value; }
31+
}
32+
private global::ProtoBuf.IExtension extensionObject;
33+
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
34+
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }
35+
}
36+
37+
}

src/Proto/PowersOfAttorney/PowerOfAttorney.proto.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// Note: requires additional types generated from: Content_v3.proto
1212
// Note: requires additional types generated from: Timestamp.proto
1313
// Note: requires additional types generated from: User.proto
14+
// Note: requires additional types generated from: DateTimeOffsetDto.proto
1415
namespace Diadoc.Api.Proto.PowersOfAttorney
1516
{
1617
[global::System.Serializable, global::ProtoBuf.ProtoContract(Name=@"PowerOfAttorneyFullId")]
@@ -134,6 +135,20 @@ public Diadoc.Api.Proto.PowersOfAttorney.PowerOfAttorneyDelegationInfo Delegatio
134135
get { return _Representatives; }
135136
}
136137

138+
private Diadoc.Api.Proto.DateTimeOffsetDto _StartAtByMoscow;
139+
[global::ProtoBuf.ProtoMember(12, IsRequired = true, Name=@"StartAtByMoscow", DataFormat = global::ProtoBuf.DataFormat.Default)]
140+
public Diadoc.Api.Proto.DateTimeOffsetDto StartAtByMoscow
141+
{
142+
get { return _StartAtByMoscow; }
143+
set { _StartAtByMoscow = value; }
144+
}
145+
private Diadoc.Api.Proto.DateTimeOffsetDto _ExpireAtByMoscow;
146+
[global::ProtoBuf.ProtoMember(13, IsRequired = true, Name=@"ExpireAtByMoscow", DataFormat = global::ProtoBuf.DataFormat.Default)]
147+
public Diadoc.Api.Proto.DateTimeOffsetDto ExpireAtByMoscow
148+
{
149+
get { return _ExpireAtByMoscow; }
150+
set { _ExpireAtByMoscow = value; }
151+
}
137152
private global::ProtoBuf.IExtension extensionObject;
138153
global::ProtoBuf.IExtension global::ProtoBuf.IExtensible.GetExtensionObject(bool createIfMissing)
139154
{ return global::ProtoBuf.Extensible.GetExtensionObject(ref extensionObject, createIfMissing); }

0 commit comments

Comments
 (0)