feat(accounting): document colleague trades on configured accounts

Post Montzar-covered buy/sell to Zarin/Tahesab/Pargar using montzar_account_* settings, and harden public storage URL/MIME handling for uploads.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-26 16:59:27 +03:30
co-authored by Cursor
parent ad78545ebd
commit 885ed33e6e
10 changed files with 457 additions and 34 deletions
+32 -1
View File
@@ -555,6 +555,31 @@ class PargarSyncService
continue;
}
if (str_ends_with(strtoupper($id), '-C')) {
$baseId = (int) substr($id, 0, -2);
if ($baseId <= 0) {
continue;
}
$log = PargarSyncLog::query()
->where('order_id', $baseId)
->where('type', self::TYPE_ORDER)
->where('sync_status', self::STATUS_PENDING)
->where('data', 'like', '%"colleague_leg":true%')
->latest('id')
->first();
if ($log) {
$this->markSuccess($log, $id, ['OrderId' => $id]);
if ($log->customer_id) {
$customerIds[(int) $log->customer_id] = true;
}
$confirmed++;
}
continue;
}
$order = Order::find($id);
if (! $order) {
continue;
@@ -563,7 +588,13 @@ class PargarSyncService
$order->pargar_confirmed_at = now();
$order->save();
$log = PargarSyncLog::where('order_id', $order->id)->latest('id')->first();
$log = PargarSyncLog::where('order_id', $order->id)
->where(function ($q) {
$q->whereNull('data')
->orWhere('data', 'not like', '%"colleague_leg":true%');
})
->latest('id')
->first();
if ($log) {
$this->markSuccess($log, (string) $order->id, ['OrderId' => (string) $order->id]);
}