deps bump
This commit is contained in:
@@ -22,7 +22,7 @@ require (
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Microsoft/go-winio v0.6.2 // indirect
|
github.com/Microsoft/go-winio v0.6.2 // indirect
|
||||||
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260112020553-64c30dda3cfd // indirect
|
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260116123424-9c8b2bad3688 // indirect
|
||||||
github.com/beorn7/perks v1.0.1 // indirect
|
github.com/beorn7/perks v1.0.1 // indirect
|
||||||
github.com/bits-and-blooms/bitset v1.24.4 // indirect
|
github.com/bits-and-blooms/bitset v1.24.4 // indirect
|
||||||
github.com/bmatcuk/doublestar/v4 v4.9.2 // indirect
|
github.com/bmatcuk/doublestar/v4 v4.9.2 // indirect
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ=
|
|||||||
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
|
github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo=
|
||||||
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
|
github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY=
|
||||||
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
|
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
|
||||||
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260112020553-64c30dda3cfd h1:ifR6oQZU+7Lqemu0dqf6X4pVWuzmMeKX6WtwZ87rH+M=
|
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260116123424-9c8b2bad3688 h1:heyVIwznmKcWu1dhijYnRnHTvRzVgWduNlLcRXFVxP8=
|
||||||
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260112020553-64c30dda3cfd/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI=
|
github.com/ProjectZKM/Ziren/crates/go-runtime/zkvm_runtime v0.0.0-20260116123424-9c8b2bad3688/go.mod h1:ioLG6R+5bUSO1oeGSDxOV3FADARuMoytZCSX6MEMQkI=
|
||||||
github.com/VictoriaMetrics/fastcache v1.13.0 h1:AW4mheMR5Vd9FkAPUv+NH6Nhw+fmbTMGMsNAoA/+4G0=
|
github.com/VictoriaMetrics/fastcache v1.13.0 h1:AW4mheMR5Vd9FkAPUv+NH6Nhw+fmbTMGMsNAoA/+4G0=
|
||||||
github.com/VictoriaMetrics/fastcache v1.13.0/go.mod h1:hHXhl4DA2fTL2HTZDJFXWgW0LNjo6B+4aj2Wmng3TjU=
|
github.com/VictoriaMetrics/fastcache v1.13.0/go.mod h1:hHXhl4DA2fTL2HTZDJFXWgW0LNjo6B+4aj2Wmng3TjU=
|
||||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
|
|||||||
@@ -0,0 +1,94 @@
|
|||||||
|
(() => {
|
||||||
|
const dbName = (typeof process !== "undefined" && process.env.MONGO_DB) ? process.env.MONGO_DB : db.getName();
|
||||||
|
const targetDb = db.getSiblingDB(dbName);
|
||||||
|
const collection = targetDb.getCollection("payment_plan_templates");
|
||||||
|
const now = new Date();
|
||||||
|
|
||||||
|
const templates = [
|
||||||
|
{
|
||||||
|
fromRail: "CRYPTO",
|
||||||
|
toRail: "LEDGER",
|
||||||
|
network: "",
|
||||||
|
isEnabled: true,
|
||||||
|
steps: [
|
||||||
|
{ stepId: "crypto_send", rail: "CRYPTO", operation: "payout.crypto" },
|
||||||
|
{ stepId: "crypto_fee", rail: "CRYPTO", operation: "fee.send", dependsOn: ["crypto_send"] },
|
||||||
|
{ stepId: "settlement_send", rail: "PROVIDER_SETTLEMENT", operation: "send", dependsOn: ["crypto_send"] },
|
||||||
|
{ stepId: "settlement_observe", rail: "PROVIDER_SETTLEMENT", operation: "observe.confirm", dependsOn: ["settlement_send"] },
|
||||||
|
{ stepId: "ledger_credit", rail: "LEDGER", operation: "ledger.credit", dependsOn: ["settlement_observe"] },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fromRail: "LEDGER",
|
||||||
|
toRail: "CARD_PAYOUT",
|
||||||
|
network: "",
|
||||||
|
isEnabled: true,
|
||||||
|
steps: [
|
||||||
|
{ stepId: "ledger_block", rail: "LEDGER", operation: "ledger.block" },
|
||||||
|
{ stepId: "card_payout", rail: "CARD_PAYOUT", operation: "payout.card", dependsOn: ["ledger_block"] },
|
||||||
|
{
|
||||||
|
stepId: "ledger_debit",
|
||||||
|
rail: "LEDGER",
|
||||||
|
operation: "ledger.debit",
|
||||||
|
dependsOn: ["card_payout"],
|
||||||
|
commitPolicy: "AFTER_SUCCESS",
|
||||||
|
commitAfter: ["card_payout"],
|
||||||
|
},
|
||||||
|
{ stepId: "ledger_release", rail: "LEDGER", operation: "ledger.release", dependsOn: ["card_payout"] },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
fromRail: "CRYPTO",
|
||||||
|
toRail: "CARD_PAYOUT",
|
||||||
|
network: "",
|
||||||
|
isEnabled: true,
|
||||||
|
steps: [
|
||||||
|
{ stepId: "crypto_send", rail: "CRYPTO", operation: "payout.crypto" },
|
||||||
|
{ stepId: "crypto_fee", rail: "CRYPTO", operation: "fee.send", dependsOn: ["crypto_send"] },
|
||||||
|
{ stepId: "settlement_send", rail: "PROVIDER_SETTLEMENT", operation: "send", dependsOn: ["crypto_send"] },
|
||||||
|
{ stepId: "settlement_observe", rail: "PROVIDER_SETTLEMENT", operation: "observe.confirm", dependsOn: ["settlement_send"] },
|
||||||
|
{ stepId: "ledger_credit", rail: "LEDGER", operation: "ledger.credit", dependsOn: ["settlement_observe"] },
|
||||||
|
{ stepId: "ledger_block", rail: "LEDGER", operation: "ledger.block", dependsOn: ["ledger_credit"] },
|
||||||
|
{ stepId: "card_payout", rail: "CARD_PAYOUT", operation: "payout.card", dependsOn: ["ledger_block"] },
|
||||||
|
{
|
||||||
|
stepId: "ledger_debit",
|
||||||
|
rail: "LEDGER",
|
||||||
|
operation: "ledger.debit",
|
||||||
|
dependsOn: ["card_payout"],
|
||||||
|
commitPolicy: "AFTER_SUCCESS",
|
||||||
|
commitAfter: ["card_payout"],
|
||||||
|
},
|
||||||
|
{ stepId: "ledger_release", rail: "LEDGER", operation: "ledger.release", dependsOn: ["card_payout"] },
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const ops = templates.map((tpl) => ({
|
||||||
|
updateOne: {
|
||||||
|
filter: {
|
||||||
|
fromRail: tpl.fromRail,
|
||||||
|
toRail: tpl.toRail,
|
||||||
|
network: tpl.network,
|
||||||
|
},
|
||||||
|
update: {
|
||||||
|
$set: {
|
||||||
|
fromRail: tpl.fromRail,
|
||||||
|
toRail: tpl.toRail,
|
||||||
|
network: tpl.network,
|
||||||
|
isEnabled: tpl.isEnabled,
|
||||||
|
steps: tpl.steps,
|
||||||
|
updatedAt: now,
|
||||||
|
},
|
||||||
|
$setOnInsert: {
|
||||||
|
_id: new ObjectId(),
|
||||||
|
createdAt: now,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
upsert: true,
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
const result = collection.bulkWrite(ops);
|
||||||
|
print("Payment plan templates upserted");
|
||||||
|
printjson(result);
|
||||||
|
})();
|
||||||
@@ -7,7 +7,7 @@ environment:
|
|||||||
|
|
||||||
# Add regular dependencies here.
|
# Add regular dependencies here.
|
||||||
dependencies:
|
dependencies:
|
||||||
analyzer: 9.0.0
|
analyzer: ^10.0.0
|
||||||
json_annotation: ^4.9.0
|
json_annotation: ^4.9.0
|
||||||
http: ^1.1.0
|
http: ^1.1.0
|
||||||
provider: ^6.0.5
|
provider: ^6.0.5
|
||||||
|
|||||||
Reference in New Issue
Block a user