fix docker deployment
This commit is contained in:
1 parent
ded52d1ece
commit
fb0f996776
17 files changed
+49
-18
No files matched your search
@@ -14,7 +14,7 @@ const cycle: Cycle = {
|
||||
chick_in_weight: 45,
|
||||
doc_in_count: 20000,
|
||||
feed_initial_balance: 0,
|
||||
status: 'gm',
|
||||
status: 'active',
|
||||
created_at: '',
|
||||
updated_at: '',
|
||||
};
|
||||
|
||||
@@ -14,7 +14,7 @@ const cycle = {
|
||||
chick_in_weight: 45,
|
||||
doc_in_count: 1000,
|
||||
feed_initial_balance: 0,
|
||||
status: 'gm',
|
||||
status: 'active',
|
||||
created_at: '',
|
||||
updated_at: '',
|
||||
} satisfies Cycle;
|
||||
|
||||
@@ -50,7 +50,9 @@ export function buildInMemoryReport(input: BuildInMemoryReportInput): DashboardR
|
||||
// Day numbering stays 0-based (day 0 = start_date), but the report must never
|
||||
// run past the cycle end date. lastDay = start_date → end_date in days, which
|
||||
// is total_days - 1 for a contiguous cycle.
|
||||
const lastDay = cycleDayForDate(cycle.start_date, cycle.end_date);
|
||||
const lastDay = cycle.end_date
|
||||
? cycleDayForDate(cycle.start_date, cycle.end_date)
|
||||
: Math.max(0, (cycle.total_days || 1) - 1);
|
||||
const endCycleUpTo = Math.min(cycle.total_days, lastDay);
|
||||
const defaultUpTo =
|
||||
input.reportType === 'end_cycle'
|
||||
@@ -202,7 +204,7 @@ export function buildInMemoryReport(input: BuildInMemoryReportInput): DashboardR
|
||||
return {
|
||||
cycleId: String(cycle.id),
|
||||
cycleStart: cycle.start_date,
|
||||
cycleEnd: cycle.end_date,
|
||||
cycleEnd: cycle.end_date ?? '',
|
||||
kandangId: input.kandangId,
|
||||
kandangName: input.kandangName,
|
||||
area: input.area,
|
||||
|
||||
@@ -38,7 +38,9 @@ function stockAkhirByDate(
|
||||
const manualByDate = new Map(manualInputs.map((m) => [m.date, m]));
|
||||
|
||||
const lastCycleDay = Math.max(0, (cycle.total_days || 1) - 1);
|
||||
const endDay = cycleDayForDate(cycle.start_date, cycle.end_date);
|
||||
const endDay = cycle.end_date
|
||||
? cycleDayForDate(cycle.start_date, cycle.end_date)
|
||||
: lastCycleDay;
|
||||
const maxDay = Math.min(lastCycleDay, endDay);
|
||||
|
||||
const result = new Map<string, number>();
|
||||
|
||||
Reference in new issue
Block a user