Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

    other supply types are not resolved on that join ("extend when confirmed").

Call chain:

    BrightInvoicesController.GetInvoices

      -> BrightInvoiceService.GetByCustomerAsync   (validate + query + map)

  1. commonValidator.ValidateCustomer(customerId) (account lookup; throws on miss)
  2. InvoicesValidator.ValidateGetInvoicesInput(...) (input range checks; throws)
  3. repository.GetByCustomerAsync(...) (resolve filters + run SQL)

            - BchecCache.EnsureLoaded(db)                         (lazy one-time BCHED load)

            - resolve InvoiceListFilters (local config ?? BCHEC)

            - InvoiceSql.GetByCustomer(filters)                   (assemble fragment SQL)

  1. map each DbInvoice row -> BrightInvoice (+ Info list)

    (SQL lives in SonWinCommonAPI/Sql/InvoiceSql.cs; source is Sonlinc.AKOND a,

     LEFT JOIN Sonlinc.AUDEBFORS ads (El only), OUTER APPLY PBSI payment sum from

     Sonlinc.AKOND, plus EXISTS over Sonlinc.AKONDDOC -> Sonlinc.BDOC for HasPdf.)

--------------------------------------------------------------------------------

...