feat: Add automatic price reduction on reposts (#691)

This commit is contained in:
Jens
2025-12-17 20:31:58 +01:00
committed by GitHub
parent 25079c32c0
commit 920ddf5533
13 changed files with 1753 additions and 22 deletions

View File

@@ -1,5 +1,76 @@
{
"$defs": {
"AutoPriceReductionConfig": {
"properties": {
"enabled": {
"default": false,
"description": "automatically lower the price of reposted ads",
"title": "Enabled",
"type": "boolean"
},
"strategy": {
"anyOf": [
{
"enum": [
"FIXED",
"PERCENTAGE"
],
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "PERCENTAGE reduces by a percentage of the previous price, FIXED reduces by a fixed amount",
"title": "Strategy"
},
"amount": {
"anyOf": [
{
"exclusiveMinimum": 0,
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "magnitude of the reduction; interpreted as percent for PERCENTAGE or currency units for FIXED",
"title": "Amount"
},
"min_price": {
"anyOf": [
{
"minimum": 0,
"type": "number"
},
{
"type": "null"
}
],
"default": null,
"description": "required when enabled is true; minimum price floor (use 0 for no lower bound)",
"title": "Min Price"
},
"delay_reposts": {
"default": 0,
"description": "number of reposts to wait before applying the first automatic price reduction",
"minimum": 0,
"title": "Delay Reposts",
"type": "integer"
},
"delay_days": {
"default": 0,
"description": "number of days to wait after publication before applying automatic price reductions",
"minimum": 0,
"title": "Delay Days",
"type": "integer"
}
},
"title": "AutoPriceReductionConfig",
"type": "object"
},
"ContactPartial": {
"properties": {
"name": {
@@ -181,6 +252,32 @@
"default": null,
"title": "Price Type"
},
"auto_price_reduction": {
"anyOf": [
{
"$ref": "#/$defs/AutoPriceReductionConfig"
},
{
"type": "null"
}
],
"default": null,
"description": "automatic price reduction configuration"
},
"repost_count": {
"default": 0,
"description": "number of successful publications for this ad (persisted between runs)",
"minimum": 0,
"title": "Repost Count",
"type": "integer"
},
"price_reduction_count": {
"default": 0,
"description": "internal counter: number of automatic price reductions already applied",
"minimum": 0,
"title": "Price Reduction Count",
"type": "integer"
},
"shipping_type": {
"anyOf": [
{