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

Scx1332/update payment7 #3322

Open
wants to merge 315 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
315 commits
Select commit Hold shift + click to select a range
06fc758
working on interval cli presentation - fix setup
scx1332 Aug 17, 2024
855c454
working on interval cli presentation - better set info
scx1332 Aug 18, 2024
681398d
working on interval cli presentation
scx1332 Aug 19, 2024
9f7c305
working on interval cli api
scx1332 Aug 20, 2024
f8bf3ef
fix error causing payments not to be confirmed
scx1332 Aug 22, 2024
abb4eb0
new profile for development
scx1332 Aug 22, 2024
2ec85d4
fix payments sum
scx1332 Aug 22, 2024
a2a42d7
fix payments sum
scx1332 Aug 23, 2024
869896f
Do not change invoice status on settled prematurely
scx1332 Aug 23, 2024
fd54e67
New version of allocation table. Working on changes accordingly
scx1332 Aug 26, 2024
4fc209f
Working on up.sql
scx1332 Aug 26, 2024
60b17c8
Work up
scx1332 Aug 26, 2024
643814d
changes in allocation
scx1332 Aug 27, 2024
364707b
changed separate pay_agreement_payment and pay_activity_payment into …
scx1332 Aug 27, 2024
2eea63c
changed name to allocation_expenditure
scx1332 Aug 27, 2024
35e5482
fix after merge
scx1332 Aug 27, 2024
bc98a7a
migration script updated
scx1332 Aug 31, 2024
0b1ee34
migrations cannot be applied
scx1332 Aug 31, 2024
b4d7d8d
fix migration script
scx1332 Aug 31, 2024
faf8ec8
fix
scx1332 Sep 1, 2024
453d790
added allocation id
scx1332 Sep 3, 2024
3c2028d
fix
scx1332 Sep 3, 2024
2e9ab02
working on allocation expenditure
scx1332 Sep 4, 2024
0597fd7
working on allocations - not compiling
scx1332 Sep 9, 2024
3ae261c
Fix compilation errors after merge-rebase
scx1332 Sep 9, 2024
963152c
Working on payments from allocation
scx1332 Sep 9, 2024
3ff4c4e
Working on payments from allocation (deposits)
scx1332 Sep 10, 2024
fa47cc2
Added deposit_status field to allocation to track deposit status
scx1332 Sep 10, 2024
a00276b
Working on allocations
scx1332 Sep 10, 2024
46a5c47
Total amount scheduled doesn't matter anymore
scx1332 Sep 10, 2024
4696bb8
Fixed issue with updating activity null values
scx1332 Sep 11, 2024
b65400b
Remove schedule message
scx1332 Sep 11, 2024
8287795
Removed dead code related to removed order table
scx1332 Sep 11, 2024
c4ecaa1
Simplify notify payment message
scx1332 Sep 11, 2024
c8e2ca1
Further simplifying the code
scx1332 Sep 11, 2024
822727f
More elegant filter
scx1332 Sep 11, 2024
858a5f5
Added post migration to sum paid activities into agreements
scx1332 Sep 11, 2024
b73a653
Added post migration to sum paid activities into agreements
scx1332 Sep 11, 2024
e277890
Add missing allocation id foreign key reference to payment documents
scx1332 Sep 11, 2024
5975c9c
Fix merge
scx1332 Sep 11, 2024
3d5cbf9
Removed unused code
scx1332 Sep 11, 2024
4a4a57c
Windows build
scx1332 Sep 16, 2024
bc8062f
Fix client version
scx1332 Sep 16, 2024
4c5293c
Fix client version
scx1332 Sep 16, 2024
6cb5f1d
Windows build
scx1332 Sep 17, 2024
1135d9e
Windows build with cache
scx1332 Sep 17, 2024
d86e5cd
Windows build with cache
scx1332 Sep 17, 2024
75afb45
Windows build with cache
scx1332 Sep 17, 2024
20a8c1e
Windows build with cache
scx1332 Sep 17, 2024
e5c0958
Windows build with cache
scx1332 Sep 17, 2024
f962a22
Windows build with cache
scx1332 Sep 17, 2024
c842d21
Windows build with cache
scx1332 Sep 17, 2024
adb65ff
Windows build with cache
scx1332 Sep 17, 2024
c37c228
Windows build with cache
scx1332 Sep 17, 2024
8d6a834
Windows build with cache
scx1332 Sep 17, 2024
93b6483
Windows build with cache
scx1332 Sep 17, 2024
426c741
Windows build with cache
scx1332 Sep 17, 2024
8b34575
Windows build with cache
scx1332 Sep 17, 2024
47293c9
Working on serve - fix payee_addr
scx1332 Sep 17, 2024
514c113
Adding frontend to build
scx1332 Sep 17, 2024
bf8ab0f
Adding frontend to build - fmt
scx1332 Sep 17, 2024
0a8bd85
Fix warnings
scx1332 Sep 17, 2024
2bdb6e9
fetch tags
scx1332 Sep 17, 2024
6d3fb4d
fetch tags automatically
scx1332 Sep 17, 2024
26301cd
fetch tags automatically
scx1332 Sep 17, 2024
fb3eb8b
fix warning
scx1332 Sep 17, 2024
fdcbeca
Update frontend
scx1332 Sep 18, 2024
a83ee8f
Fix fronted display
scx1332 Sep 18, 2024
debd903
Fix fronted display
scx1332 Sep 18, 2024
1b37b63
Fix fronted
scx1332 Sep 18, 2024
9a27c06
Fix problems with pay_payments
scx1332 Sep 18, 2024
0c6ebdd
Gather allocations without deposit into group and sum payments accord…
scx1332 Sep 19, 2024
b85b125
Update payments
scx1332 Jul 29, 2024
d172027
fmt
scx1332 Jul 29, 2024
cc2ce72
wip
scx1332 Jul 29, 2024
57a8215
wip
scx1332 Jul 30, 2024
524c2b3
All debit notes payable
scx1332 Jul 30, 2024
783c155
Fix value paid
scx1332 Jul 30, 2024
264048e
Work in progress
scx1332 Jul 30, 2024
4502644
Working on flush payments
scx1332 Jul 31, 2024
256fd6e
Merging Reqc code
scx1332 Aug 1, 2024
f84722a
Merging Reqc code
scx1332 Aug 1, 2024
c223a90
Merging Reqc code
scx1332 Aug 1, 2024
5dd4819
Merging Reqc code
scx1332 Aug 1, 2024
7b26d53
working on mockup data for testing
scx1332 Aug 2, 2024
025ffa1
wip
scx1332 Aug 2, 2024
8ef83ba
wip
scx1332 Aug 2, 2024
c846dbd
wip
scx1332 Aug 2, 2024
e90c439
wip
scx1332 Aug 2, 2024
a3216aa
extending API
scx1332 Aug 3, 2024
1d47939
extending API
scx1332 Aug 3, 2024
00a8951
extending API
scx1332 Aug 3, 2024
2fa8634
extending API
scx1332 Aug 3, 2024
f4c27fa
extending API - added debit note chain query for activity
scx1332 Aug 4, 2024
a54b59b
extending API - added debit note chain query for activity
scx1332 Aug 4, 2024
5066e12
fix date generation in mockup generator
scx1332 Aug 4, 2024
ebe8f89
remove debug message
scx1332 Aug 4, 2024
c77ac26
fmt
scx1332 Aug 4, 2024
89625a2
fix foreign keys in db
scx1332 Aug 4, 2024
f652e20
add get invoice route
scx1332 Aug 4, 2024
2ae87dc
wip
scx1332 Aug 6, 2024
963beab
working on batch payments
scx1332 Aug 6, 2024
14e9a12
working on batch payments
scx1332 Aug 6, 2024
e5088cb
working on batch payments, fix floats and format
scx1332 Aug 6, 2024
35f605a
wip-not working
scx1332 Aug 7, 2024
ad61311
API for batch orders
scx1332 Aug 7, 2024
b92f77c
working on API for batch orders
scx1332 Aug 7, 2024
25fb3c2
working on API for batch orders, separating resolve invoices from res…
scx1332 Aug 7, 2024
e861005
first process activities, then invoices improving queries and account…
scx1332 Aug 7, 2024
bbd33fe
removed unused table payment
scx1332 Aug 7, 2024
66259f3
Added debit_nonce field to debit notes
scx1332 Aug 8, 2024
b2bdce8
Improving API
scx1332 Aug 8, 2024
e1811ee
Improvements
scx1332 Aug 8, 2024
0755053
Improvements
scx1332 Aug 8, 2024
087b17b
Working on additional messages
scx1332 Aug 9, 2024
a353bca
removed driver
scx1332 Aug 9, 2024
49839ec
fixed what was broken, created DebitNotForApi
scx1332 Aug 9, 2024
9b6bd07
fmt
scx1332 Aug 9, 2024
88cfbbe
working on resolving invoices
scx1332 Aug 10, 2024
6bebddf
working on resolving invoices
scx1332 Aug 10, 2024
e10e1c0
fmt
scx1332 Aug 10, 2024
3b217a9
fix
scx1332 Aug 11, 2024
d18e6ab
fix
scx1332 Aug 11, 2024
677b4b0
fix compilation after merge
scx1332 Aug 12, 2024
16329c3
move migrations
scx1332 Aug 12, 2024
c1f5ecc
work on cycles
scx1332 Aug 13, 2024
f3a660f
work on cycles
scx1332 Aug 13, 2024
23e82f0
work on cycles update
scx1332 Aug 13, 2024
05c47d6
fmt
scx1332 Aug 13, 2024
bfe2c05
working on batch cycles
scx1332 Aug 13, 2024
61544b0
added api
scx1332 Aug 13, 2024
8cc0036
added platform to cycles
scx1332 Aug 14, 2024
154d496
fmt
scx1332 Aug 14, 2024
0e7e3d1
working on cron
scx1332 Aug 14, 2024
0a78b5c
working on nice cli presentation
scx1332 Aug 16, 2024
8d8a3af
working on interval cli presentation
scx1332 Aug 16, 2024
0195f53
working on interval cli presentation
scx1332 Aug 17, 2024
d795ffc
working on interval cli presentation - fix setup
scx1332 Aug 17, 2024
fde2e12
working on interval cli presentation - better set info
scx1332 Aug 18, 2024
1a85217
working on interval cli presentation
scx1332 Aug 19, 2024
bfb8fa0
working on interval cli api
scx1332 Aug 20, 2024
68908a5
fix error causing payments not to be confirmed
scx1332 Aug 22, 2024
1813687
fix payments sum
scx1332 Aug 22, 2024
a9efe75
fix payments sum
scx1332 Aug 23, 2024
09debb0
Do not change invoice status on settled prematurely
scx1332 Aug 23, 2024
2ab5c2c
New version of allocation table. Working on changes accordingly
scx1332 Aug 26, 2024
82711cd
Working on up.sql
scx1332 Aug 26, 2024
4e7dc33
Work up
scx1332 Aug 26, 2024
f3984fb
changes in allocation
scx1332 Aug 27, 2024
e94d6db
changed separate pay_agreement_payment and pay_activity_payment into …
scx1332 Aug 27, 2024
a898c3b
changed name to allocation_expenditure
scx1332 Aug 27, 2024
153252d
fix after merge
scx1332 Aug 27, 2024
2752a97
migration script updated
scx1332 Aug 31, 2024
cbff504
migrations cannot be applied
scx1332 Aug 31, 2024
0f5e0b6
fix migration script
scx1332 Aug 31, 2024
bc0129c
fix
scx1332 Sep 1, 2024
53a765b
added allocation id
scx1332 Sep 3, 2024
ec6fe83
fix
scx1332 Sep 3, 2024
3296cf4
working on allocation expenditure
scx1332 Sep 4, 2024
86e17f3
working on allocations - not compiling
scx1332 Sep 9, 2024
cef5592
Fix compilation errors after merge-rebase
scx1332 Sep 9, 2024
6fb01e7
Working on payments from allocation
scx1332 Sep 9, 2024
a67b69c
Working on payments from allocation (deposits)
scx1332 Sep 10, 2024
038d68b
Added deposit_status field to allocation to track deposit status
scx1332 Sep 10, 2024
dfea4a3
Working on allocations
scx1332 Sep 10, 2024
1b0bc28
Total amount scheduled doesn't matter anymore
scx1332 Sep 10, 2024
2e871a9
Fixed issue with updating activity null values
scx1332 Sep 11, 2024
54fc125
Remove schedule message
scx1332 Sep 11, 2024
5d3c37b
Removed dead code related to removed order table
scx1332 Sep 11, 2024
926e25d
Simplify notify payment message
scx1332 Sep 11, 2024
18a72c6
Further simplifying the code
scx1332 Sep 11, 2024
b2d5988
More elegant filter
scx1332 Sep 11, 2024
c1b9c91
Added post migration to sum paid activities into agreements
scx1332 Sep 11, 2024
a33443f
Added post migration to sum paid activities into agreements
scx1332 Sep 11, 2024
70f05f5
Add missing allocation id foreign key reference to payment documents
scx1332 Sep 11, 2024
5efa4ae
Fix merge
scx1332 Sep 11, 2024
1f5ad9d
Removed unused code
scx1332 Sep 11, 2024
ca25eb6
Windows build
scx1332 Sep 16, 2024
d9ac102
Fix client version
scx1332 Sep 16, 2024
3032f74
Fix client version
scx1332 Sep 16, 2024
5a7be68
Windows build
scx1332 Sep 17, 2024
e13cdd8
Windows build with cache
scx1332 Sep 17, 2024
a8a17e4
Windows build with cache
scx1332 Sep 17, 2024
31bd0ec
Windows build with cache
scx1332 Sep 17, 2024
4e90c6a
Windows build with cache
scx1332 Sep 17, 2024
02dc9e4
Windows build with cache
scx1332 Sep 17, 2024
a6c24fa
Windows build with cache
scx1332 Sep 17, 2024
fdd950a
Windows build with cache
scx1332 Sep 17, 2024
98051a3
Windows build with cache
scx1332 Sep 17, 2024
c2da24a
Windows build with cache
scx1332 Sep 17, 2024
6e3d88d
Windows build with cache
scx1332 Sep 17, 2024
14fd44d
Windows build with cache
scx1332 Sep 17, 2024
809325b
Windows build with cache
scx1332 Sep 17, 2024
93e41ed
Windows build with cache
scx1332 Sep 17, 2024
b42a025
Working on serve - fix payee_addr
scx1332 Sep 17, 2024
eaf3a51
Adding frontend to build
scx1332 Sep 17, 2024
cb6d7a6
Adding frontend to build - fmt
scx1332 Sep 17, 2024
e494ba4
fetch tags
scx1332 Sep 17, 2024
7579507
fetch tags automatically
scx1332 Sep 17, 2024
bdba883
fetch tags automatically
scx1332 Sep 17, 2024
abd49eb
Update frontend
scx1332 Sep 18, 2024
d6153df
Fix fronted display
scx1332 Sep 18, 2024
55b9132
Fix fronted display
scx1332 Sep 18, 2024
4bbe678
Fix fronted
scx1332 Sep 18, 2024
fa3066f
Fix problems with pay_payments
scx1332 Sep 18, 2024
074df44
Gather allocations without deposit into group and sum payments accord…
scx1332 Sep 19, 2024
93244ff
Merge branch 'scx1332/update_payment6' of https://github.com/golemfac…
scx1332 Sep 19, 2024
ff2baf9
Working on payment notifications
scx1332 Sep 19, 2024
f57de06
Working on payment notifications for peers
scx1332 Sep 19, 2024
f1ecbf4
Merge branch 'refs/heads/master' into scx1332/update_payment7
scx1332 Sep 19, 2024
84df434
Merging
scx1332 Sep 19, 2024
ff470e5
Merge branch 'refs/heads/master' into scx1332/update_payment7
scx1332 Sep 19, 2024
8ab82ba
Fix ya-client version
scx1332 Sep 19, 2024
87a5e82
db manip moved to separate repo
scx1332 Sep 20, 2024
46d8169
Added deduplication of merged allocations into payment
scx1332 Sep 20, 2024
32a67cd
Merge branch 'refs/heads/master' into scx1332/update_payment7
scx1332 Sep 20, 2024
ea9b847
Fix after merge
scx1332 Sep 20, 2024
9c89aa6
Reverting unneeded changes
scx1332 Sep 20, 2024
9a09fed
Removed unused code
scx1332 Sep 20, 2024
6357a38
fmt
scx1332 Sep 20, 2024
2d48212
moved post migration into separate file
scx1332 Sep 20, 2024
7486a33
Removed unused message
scx1332 Sep 20, 2024
bfbd9c3
Removed paid column. paid_amount is updated now
scx1332 Sep 20, 2024
d61a86b
Better order behaviour. Update date shows when last payment was done
scx1332 Sep 20, 2024
f3977c7
Fix index name
scx1332 Sep 21, 2024
b5a1aa6
Add primary key to pay_payment table
scx1332 Sep 23, 2024
b51e3ff
Fixed migration
scx1332 Sep 23, 2024
09fbd40
Fix missing columns and change signature and signed_bytes to blob and…
scx1332 Sep 23, 2024
6603d92
Added peer id to document payment
scx1332 Sep 24, 2024
49f4e28
Merge branch 'master' into scx1332/update_payment7
scx1332 Sep 24, 2024
82e680b
Fix script
scx1332 Sep 24, 2024
7bbe18d
useful sql scripts
scx1332 Sep 24, 2024
dd8d566
Fix schema relationship for document payment
scx1332 Sep 24, 2024
596eaad
Batch cycles improvements
scx1332 Oct 1, 2024
3e2a74e
improve batch cycle message
scx1332 Oct 1, 2024
c6a60ed
Merge branch 'refs/heads/master' into scx1332/update_payment7
scx1332 Oct 1, 2024
14647bc
Update after merge
scx1332 Oct 1, 2024
d76b39c
Check if goth will work when set 24s interval
scx1332 Oct 1, 2024
a810c06
fix goth test
scx1332 Oct 1, 2024
96bab17
fix goth tests
scx1332 Oct 1, 2024
718e877
fix logs
scx1332 Oct 1, 2024
4a659b8
fix logs2
scx1332 Oct 1, 2024
13886a6
lock
scx1332 Oct 1, 2024
eb0a8ef
lock
scx1332 Oct 1, 2024
19ca895
lock
scx1332 Oct 1, 2024
fe220ea
change default payment cycle
scx1332 Oct 2, 2024
c78a6ab
Merge branch 'master' into scx1332/update_payment7
scx1332 Oct 3, 2024
6e8585a
todo fix
scx1332 Oct 3, 2024
dd37419
Merge branch 'master' into scx1332/update_payment7
scx1332 Oct 3, 2024
e4bc611
Merge branch 'master' into scx1332/update_payment7
scx1332 Oct 3, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/unit-test-sgx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
working-directory: exe-unit
run: |
echo "TODO: fix sgx tests"
# cargo test --features sgx
# cargo test --features sgx
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ db.sqlite-wal

# bak files (generated by notepad++)
**/*.bak

# Suggested debug data dirs
yagnadir
providerdir

*.bat
18 changes: 16 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ arc_with_non_send_sync = "allow"
blocks_in_conditions = "allow"
get_first = "allow"
doc_lazy_continuation = "allow"
len_zero = "allow"

[workspace]
members = [
Expand Down Expand Up @@ -287,8 +288,8 @@ ya-sb-proto = { version = "0.6.2" }
ya-sb-util = { version = "0.5.1" }
parking_lot = "0.12.3"
mime = "0.3.17"
ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "653e7ed3ff8836837b660a76e604055e167b1f2e" }
ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "653e7ed3ff8836837b660a76e604055e167b1f2e" }
ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "b4bf2aab46181d594dcba5b6956c03172ee1f2ea" }
ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "b4bf2aab46181d594dcba5b6956c03172ee1f2ea" }

ya-compile-time-utils.path = "utils/compile-time-utils"
ya-manifest-utils = { path = "utils/manifest-utils" }
Expand Down Expand Up @@ -325,8 +326,8 @@ ya-framework-basic.path = "test-utils/test-framework/framework-basic"
ya-framework-mocks.path = "test-utils/test-framework/framework-mocks"

[patch.crates-io]
ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "653e7ed3ff8836837b660a76e604055e167b1f2e" }
ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "653e7ed3ff8836837b660a76e604055e167b1f2e" }
ya-client = { git = "https://github.com/golemfactory/ya-client.git", rev = "b4bf2aab46181d594dcba5b6956c03172ee1f2ea" }
ya-client-model = { git = "https://github.com/golemfactory/ya-client.git", rev = "b4bf2aab46181d594dcba5b6956c03172ee1f2ea" }
golem-certificate = { git = "https://github.com/golemfactory/golem-certificate.git", rev = "f2d7514c18fc066e9cfb796090b90f5b27cfe1c6" }
ethereum-tx-sign = { git = "https://github.com/golemfactory/ethereum-tx-sign.git", rev = "1164c74187a9e2947faeaea7dde104c3cdec4195" }
graphene-sgx = { git = " https://github.com/golemfactory/graphene-rust.git", rev = "dbd993ebad7f9190410ea390a589348479af6407" }
Expand Down
2 changes: 1 addition & 1 deletion core/activity/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl ResponseError for Error {
}
_ => {
let e = self.to_string();
log::error!("Activity API server error: {}", e);
//log::error!("Activity API server error: {}", e);
HttpResponse::InternalServerError().json(ErrorMessage::new(e))
}
}
Expand Down
42 changes: 41 additions & 1 deletion core/model/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ use derive_more::From;
use serde::{Deserialize, Serialize};
use std::fmt::Display;
use std::time::Duration;
use ya_client_model::payment::{allocation::Deposit, Allocation, DriverStatusProperty, Payment};
use ya_client_model::payment::{
allocation::Allocation, allocation::Deposit, DriverStatusProperty, Payment,
};
use ya_client_model::NodeId;
use ya_service_bus::RpcMessage;

pub fn driver_bus_id<T: Display>(driver_name: T) -> String {
Expand Down Expand Up @@ -296,6 +299,43 @@ impl RpcMessage for Init {
type Error = GenericError;
}

// ************************** FLUSH PAYMENTS **************************

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct FlushPayments {
node_id: Option<NodeId>,
flush_date: DateTime<Utc>,
}

impl FlushPayments {
pub fn new(node_id: Option<NodeId>, flush_date: DateTime<Utc>) -> FlushPayments {
FlushPayments {
node_id,
flush_date,
}
}

pub fn flush_date(&self) -> DateTime<Utc> {
self.flush_date
}

pub fn node_id(&self) -> Option<NodeId> {
self.node_id
}
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub enum FlushPaymentResult {
FlushScheduled,
FlushNotNeeded,
}

impl RpcMessage for FlushPayments {
const ID: &'static str = "FlushPayments";
type Item = FlushPaymentResult;
type Error = GenericError;
}

// ************************** SCHEDULE PAYMENT **************************

#[derive(Clone, Debug, Serialize, Deserialize)]
Expand Down
Loading
Loading