Backend
total field; charges are defined in chargeSchema with bundleDiscountAmount, isPrimary, and _bundleId. The logic that computes quote or inspection total (including when to derive it from primary vs. sum of all charges) must respect a new setting. Likely touchpoints include quote creation and update (e.g. src/util/functions/quote/createQuoteWithCharges.ts, src/util/functions/quote/createOrUpdateDraft.ts) and any route or aggregation that computes or returns quote total (e.g. src/routes/quote.ts). Bundle-related logic appears in src/util/functions/charge/createOrUpdateCharges.ts, src/util/functions/inspection/createInspection.ts (bundle discount amounts, and totalFromCharges around line 240), and the bundle route in src/routes/bundle.js. Document resolution and data exports that sum charges (e.g. src/util/functions/dataExports/documentResolution.ts, src/util/functions/dataExports/aggregationHelpers.ts) may need to stay consistent with the chosen totaling behavior where quote or inspection totals are used._companyId on quotes, charges, inspections). A new setting (e.g. "total bundle discounts from primary" or equivalent) must be stored and read at the appropriate scope (company, brand, or instance—decision needed). Existing patterns for per-company or per-instance settings can be found in schemas such as src/models/scheduleSettingsSchema.ts and src/models/appPaymentsSettingSchema.ts; the new toggle should follow the same scope and storage approach once decided.Frontend
Decision needed
attik-backend/src/models/chargeSchema.ts, attik-backend/src/models/quoteSchema.tsattik-backend/src/util/functions/quote/createQuoteWithCharges.ts, attik-backend/src/util/functions/quote/createOrUpdateDraft.tsattik-backend/src/util/functions/inspection/createInspection.ts (e.g. totalFromCharges)attik-backend/src/routes/bundle.js (via protectedRouteBarrel.ts)attik-backend/src/models/scheduleSettingsSchema.ts, attik-backend/src/models/appPaymentsSettingSchema.tsPlease authenticate to join the conversation.
Completed
New Features
2 months ago
Linear
Get notified by email when there are changes.
Completed
New Features
2 months ago
Linear
Get notified by email when there are changes.