Legacy never posted order debt; updateRemain recomputed it as SUM(orders.input) WHERE sts > 4. The port posted it once on entering DELIVERED_TO_AGENT, guarded on deliveredAt, which: - posted it twice when an order reached that status again - posted nothing for an order sent straight to DELIVERED_TO_CUSTOMER - kept it after a rollback or cancellation syncOrderDebt compares what the order should owe with the confirmed ORDER_STOCK entries on it and posts only the difference (append-only, idempotent). Status removal runs it too, so removing «تحویل به نماینده» is allowed again, as in legacy. Existing data: 0 orders out of line. Owner approval: 2026-10-08. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
14 lines
534 B
TypeScript
14 lines
534 B
TypeScript
import { Module } from '@nestjs/common';
|
|
import { PrismaModule } from '../../prisma/prisma.module';
|
|
import { OrdersModule } from '../orders/orders.module';
|
|
import { AccountingModule } from '../accounting/accounting.module';
|
|
import { AdminOrdersController } from './admin-orders.controller';
|
|
import { AdminOrdersService } from './admin-orders.service';
|
|
|
|
@Module({
|
|
imports: [PrismaModule, OrdersModule, AccountingModule],
|
|
controllers: [AdminOrdersController],
|
|
providers: [AdminOrdersService],
|
|
})
|
|
export class AdminOrdersModule {}
|