Skip to content

Commit d170f34

Browse files
authored
Add Request Deadlines to Bill History (#741)
1 parent b36c585 commit d170f34

File tree

5 files changed

+24
-0
lines changed

5 files changed

+24
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* Properly separate `protocol` parts from `application` in `bcr-ebill-core` (breaking for Library dependents, breaking DB change)
1515
* Remove email from anon identities and contacts
1616
* Change document max file size to 10 MB and max files on bill to 20
17+
* Add request deadlines to BillHistoryBlock
1718

1819
# 0.4.12
1920

crates/bcr-ebill-core/src/protocol/blockchain/bill/block.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,6 +1125,7 @@ impl BillBlock {
11251125
BillHistoryBlock::new(
11261126
self,
11271127
None,
1128+
None,
11281129
SignedBy::from((
11291130
BillParticipantBlockData::Ident(block_data_decrypted.drawer),
11301131
block_data_decrypted.signatory,
@@ -1138,6 +1139,7 @@ impl BillBlock {
11381139
BillHistoryBlock::new(
11391140
self,
11401141
Some(block_data_decrypted.endorsee.into()),
1142+
None,
11411143
SignedBy::from((
11421144
block_data_decrypted.endorser,
11431145
block_data_decrypted.signatory,
@@ -1151,6 +1153,7 @@ impl BillBlock {
11511153
BillHistoryBlock::new(
11521154
self,
11531155
Some(block_data_decrypted.endorsee.into()),
1156+
None,
11541157
SignedBy::from((
11551158
block_data_decrypted.endorser,
11561159
block_data_decrypted.signatory,
@@ -1164,6 +1167,7 @@ impl BillBlock {
11641167
BillHistoryBlock::new(
11651168
self,
11661169
None,
1170+
Some(block_data_decrypted.acceptance_deadline_timestamp),
11671171
SignedBy::from((
11681172
block_data_decrypted.requester,
11691173
block_data_decrypted.signatory,
@@ -1177,6 +1181,7 @@ impl BillBlock {
11771181
BillHistoryBlock::new(
11781182
self,
11791183
None,
1184+
None,
11801185
SignedBy::from((
11811186
BillParticipantBlockData::Ident(block_data_decrypted.accepter),
11821187
block_data_decrypted.signatory,
@@ -1190,6 +1195,7 @@ impl BillBlock {
11901195
BillHistoryBlock::new(
11911196
self,
11921197
None,
1198+
Some(block_data_decrypted.payment_deadline_timestamp),
11931199
SignedBy::from((
11941200
block_data_decrypted.requester,
11951201
block_data_decrypted.signatory,
@@ -1203,6 +1209,7 @@ impl BillBlock {
12031209
BillHistoryBlock::new(
12041210
self,
12051211
Some(block_data_decrypted.buyer.into()),
1212+
Some(block_data_decrypted.buying_deadline_timestamp),
12061213
SignedBy::from((block_data_decrypted.seller, block_data_decrypted.signatory)),
12071214
block_data_decrypted.signing_address,
12081215
)
@@ -1213,6 +1220,7 @@ impl BillBlock {
12131220
BillHistoryBlock::new(
12141221
self,
12151222
Some(block_data_decrypted.buyer.into()),
1223+
None,
12161224
SignedBy::from((block_data_decrypted.seller, block_data_decrypted.signatory)),
12171225
block_data_decrypted.signing_address,
12181226
)
@@ -1223,6 +1231,7 @@ impl BillBlock {
12231231
BillHistoryBlock::new(
12241232
self,
12251233
None,
1234+
None,
12261235
SignedBy::from((
12271236
BillParticipantBlockData::Ident(block_data_decrypted.rejecter),
12281237
block_data_decrypted.signatory,
@@ -1236,6 +1245,7 @@ impl BillBlock {
12361245
BillHistoryBlock::new(
12371246
self,
12381247
None,
1248+
None,
12391249
SignedBy::from((
12401250
BillParticipantBlockData::Ident(block_data_decrypted.rejecter),
12411251
block_data_decrypted.signatory,
@@ -1249,6 +1259,7 @@ impl BillBlock {
12491259
BillHistoryBlock::new(
12501260
self,
12511261
None,
1262+
None,
12521263
SignedBy::from((
12531264
BillParticipantBlockData::Ident(block_data_decrypted.rejecter),
12541265
block_data_decrypted.signatory,
@@ -1262,6 +1273,7 @@ impl BillBlock {
12621273
BillHistoryBlock::new(
12631274
self,
12641275
None,
1276+
None,
12651277
SignedBy::from((
12661278
block_data_decrypted.rejecter,
12671279
block_data_decrypted.signatory,
@@ -1275,6 +1287,7 @@ impl BillBlock {
12751287
BillHistoryBlock::new(
12761288
self,
12771289
Some(BillParticipantBlockData::Ident(block_data_decrypted.recoursee).into()),
1290+
Some(block_data_decrypted.recourse_deadline_timestamp),
12781291
SignedBy::from((
12791292
block_data_decrypted.recourser,
12801293
block_data_decrypted.signatory,
@@ -1288,6 +1301,7 @@ impl BillBlock {
12881301
BillHistoryBlock::new(
12891302
self,
12901303
Some(BillParticipantBlockData::Ident(block_data_decrypted.recoursee).into()),
1304+
None,
12911305
SignedBy::from((
12921306
block_data_decrypted.recourser,
12931307
block_data_decrypted.signatory,

crates/bcr-ebill-core/src/protocol/blockchain/bill/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ pub struct BillHistoryBlock {
278278
pub block_id: BlockId,
279279
pub block_type: BillOpCode,
280280
pub pay_to_the_order_of: Option<BillParticipant>,
281+
pub request_deadline: Option<Timestamp>,
281282
pub signed: SignedBy,
282283
pub signing_timestamp: Timestamp,
283284
pub signing_address: Option<PostalAddress>,
@@ -287,13 +288,15 @@ impl BillHistoryBlock {
287288
pub fn new(
288289
block: &BillBlock,
289290
pay_to_the_order_of: Option<BillParticipant>,
291+
request_deadline: Option<Timestamp>,
290292
signed: SignedBy,
291293
signing_address: Option<PostalAddress>,
292294
) -> Self {
293295
Self {
294296
block_id: block.id(),
295297
block_type: block.op_code().to_owned(),
296298
pay_to_the_order_of,
299+
request_deadline,
297300
signed,
298301
signing_timestamp: block.timestamp(),
299302
signing_address,

crates/bcr-ebill-persistence/src/db/bill.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,7 @@ pub struct BillHistoryBlockDb {
921921
pub block_id: BlockId,
922922
pub block_type: BillOpCode,
923923
pub pay_to_the_order_of: Option<BillParticipantDb>,
924+
pub request_deadline: Option<Timestamp>,
924925
pub signed: LightSignedByDb,
925926
pub signing_timestamp: Timestamp,
926927
pub signing_address: Option<PostalAddressDb>,
@@ -932,6 +933,7 @@ impl From<BillHistoryBlockDb> for BillHistoryBlock {
932933
block_id: value.block_id,
933934
block_type: value.block_type,
934935
pay_to_the_order_of: value.pay_to_the_order_of.map(|pttoo| pttoo.into()),
936+
request_deadline: value.request_deadline,
935937
signed: value.signed.into(),
936938
signing_timestamp: value.signing_timestamp,
937939
signing_address: value.signing_address.map(|sa| sa.into()),
@@ -945,6 +947,7 @@ impl From<BillHistoryBlock> for BillHistoryBlockDb {
945947
block_id: value.block_id,
946948
block_type: value.block_type,
947949
pay_to_the_order_of: value.pay_to_the_order_of.as_ref().map(|pttoo| pttoo.into()),
950+
request_deadline: value.request_deadline,
948951
signed: (&value.signed).into(),
949952
signing_timestamp: value.signing_timestamp,
950953
signing_address: value.signing_address.map(|sa| sa.into()),

crates/bcr-ebill-wasm/src/data/bill.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ pub struct BillHistoryBlockWeb {
310310
pub block_id: BlockId,
311311
pub block_type: BillOpCodeWeb,
312312
pub pay_to_the_order_of: Option<LightBillParticipantWeb>,
313+
#[tsify(type = "number | undefined")]
314+
pub request_deadline: Option<Timestamp>,
313315
pub signed: LightSignedByWeb,
314316
#[tsify(type = "number")]
315317
pub signing_timestamp: Timestamp,
@@ -324,6 +326,7 @@ impl From<BillHistoryBlock> for BillHistoryBlockWeb {
324326
pay_to_the_order_of: value
325327
.pay_to_the_order_of
326328
.map(|pttoo| LightBillParticipant::from(pttoo).into()),
329+
request_deadline: value.request_deadline,
327330
signed: value.signed.into(),
328331
signing_timestamp: value.signing_timestamp,
329332
signing_address: value.signing_address.map(|sa| sa.into()),

0 commit comments

Comments
 (0)