@autologix-engineering/shared 1.2.355 → 1.2.356
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/lib/commands/src/generate.pdf.invoice.d.ts +0 -1
- package/src/lib/commands/src/generate.pdf.invoice.js.map +1 -1
- package/src/lib/contract-state/src/contract.coverage.bound.d.ts +37 -0
- package/src/lib/contract-state/src/contract.coverage.bound.js +45 -0
- package/src/lib/contract-state/src/contract.coverage.bound.js.map +1 -0
- package/src/lib/contract-state/src/index.d.ts +1 -0
- package/src/lib/contract-state/src/index.js +1 -0
- package/src/lib/contract-state/src/index.js.map +1 -1
- package/src/lib/data-transfer-objects/src/add.ltr.payout.rows.dto.d.ts +66 -0
- package/src/lib/data-transfer-objects/src/add.ltr.payout.rows.dto.js +139 -0
- package/src/lib/data-transfer-objects/src/add.ltr.payout.rows.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/calculate.non.pool.ltr.invoice.data.dto.d.ts +1 -0
- package/src/lib/data-transfer-objects/src/calculate.non.pool.ltr.invoice.data.dto.js +5 -0
- package/src/lib/data-transfer-objects/src/calculate.non.pool.ltr.invoice.data.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/command/add.ltr.vehicle.master.dto.d.ts +1 -0
- package/src/lib/data-transfer-objects/src/command/add.ltr.vehicle.master.dto.js +5 -0
- package/src/lib/data-transfer-objects/src/command/add.ltr.vehicle.master.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/command/add.tds.config.dto.d.ts +7 -0
- package/src/lib/data-transfer-objects/src/command/add.tds.config.dto.js +30 -0
- package/src/lib/data-transfer-objects/src/command/add.tds.config.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/command/index.d.ts +4 -0
- package/src/lib/data-transfer-objects/src/command/index.js +4 -0
- package/src/lib/data-transfer-objects/src/command/index.js.map +1 -1
- package/src/lib/data-transfer-objects/src/command/post.corporate.alerts.dto.js +6 -0
- package/src/lib/data-transfer-objects/src/command/post.corporate.alerts.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/command/retry.generate.irn.dto.d.ts +3 -0
- package/src/lib/data-transfer-objects/src/command/retry.generate.irn.dto.js +9 -0
- package/src/lib/data-transfer-objects/src/command/retry.generate.irn.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/command/update.ltr.request.dto.d.ts +1 -1
- package/src/lib/data-transfer-objects/src/command/update.ltr.request.dto.js +1 -0
- package/src/lib/data-transfer-objects/src/command/update.ltr.request.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/command/update.tds.config.dto.d.ts +11 -0
- package/src/lib/data-transfer-objects/src/command/update.tds.config.dto.js +30 -0
- package/src/lib/data-transfer-objects/src/command/update.tds.config.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/command/update.tds.config.status.dto.d.ts +7 -0
- package/src/lib/data-transfer-objects/src/command/update.tds.config.status.dto.js +22 -0
- package/src/lib/data-transfer-objects/src/command/update.tds.config.status.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/create.update.ba.contract.dto.d.ts +2 -0
- package/src/lib/data-transfer-objects/src/create.update.ba.contract.dto.js +10 -0
- package/src/lib/data-transfer-objects/src/create.update.ba.contract.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/create.vendor.dto.d.ts +1 -0
- package/src/lib/data-transfer-objects/src/create.vendor.dto.js +7 -1
- package/src/lib/data-transfer-objects/src/create.vendor.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/discard.business.associate.payout.draft.dto.d.ts +7 -0
- package/src/lib/data-transfer-objects/src/discard.business.associate.payout.draft.dto.js +28 -0
- package/src/lib/data-transfer-objects/src/discard.business.associate.payout.draft.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/duties.query.dto.d.ts +14 -0
- package/src/lib/data-transfer-objects/src/duties.query.dto.js +5 -0
- package/src/lib/data-transfer-objects/src/duties.query.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/create.onboarding.user.dto.d.ts +1 -0
- package/src/lib/data-transfer-objects/src/gatekeeper/create.onboarding.user.dto.js +8 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/create.onboarding.user.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/get.registered.user.ltr.dto.d.ts +7 -0
- package/src/lib/data-transfer-objects/src/gatekeeper/get.registered.user.ltr.dto.js +21 -0
- package/src/lib/data-transfer-objects/src/gatekeeper/get.registered.user.ltr.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/gatekeeper/get.user.by.phone.dto.d.ts +1 -0
- package/src/lib/data-transfer-objects/src/gatekeeper/get.user.by.phone.dto.js +8 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/get.user.by.phone.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/index.d.ts +2 -0
- package/src/lib/data-transfer-objects/src/gatekeeper/index.js +2 -0
- package/src/lib/data-transfer-objects/src/gatekeeper/index.js.map +1 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/send.email.login.otp.dto.d.ts +37 -0
- package/src/lib/data-transfer-objects/src/gatekeeper/send.email.login.otp.dto.js +36 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/send.email.login.otp.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/send.ltr.sign.off.otp.dto.d.ts +17 -0
- package/src/lib/data-transfer-objects/src/gatekeeper/send.ltr.sign.off.otp.dto.js +29 -0
- package/src/lib/data-transfer-objects/src/gatekeeper/send.ltr.sign.off.otp.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/get.active.preferred.package.dto.d.ts +1 -0
- package/src/lib/data-transfer-objects/src/get.active.preferred.package.dto.js +6 -1
- package/src/lib/data-transfer-objects/src/get.active.preferred.package.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/get.business.associate.payout.draft.dto.d.ts +25 -0
- package/src/lib/data-transfer-objects/src/get.business.associate.payout.draft.dto.js +25 -0
- package/src/lib/data-transfer-objects/src/get.business.associate.payout.draft.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.bookings.dto.d.ts +5 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.bookings.dto.js +17 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.bookings.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.logs.dto.d.ts +18 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.logs.dto.js +33 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.logs.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.sign.off.preview.dto.d.ts +33 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.sign.off.preview.dto.js +36 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.sign.off.preview.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.payout.rows.dto.d.ts +66 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.payout.rows.dto.js +53 -0
- package/src/lib/data-transfer-objects/src/get.ltr.driver.payout.rows.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/get.ltr.vehicle.master.dto.d.ts +1 -0
- package/src/lib/data-transfer-objects/src/get.ltr.vehicle.master.dto.js +9 -2
- package/src/lib/data-transfer-objects/src/get.ltr.vehicle.master.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/get.tds.config.dto.d.ts +9 -0
- package/src/lib/data-transfer-objects/src/get.tds.config.dto.js +34 -0
- package/src/lib/data-transfer-objects/src/get.tds.config.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/gst.dto.d.ts +9 -4
- package/src/lib/data-transfer-objects/src/gst.dto.js +9 -1
- package/src/lib/data-transfer-objects/src/gst.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/index.d.ts +14 -2
- package/src/lib/data-transfer-objects/src/index.js +14 -2
- package/src/lib/data-transfer-objects/src/index.js.map +1 -1
- package/src/lib/data-transfer-objects/src/passenger.persona.custom.dto.d.ts +1 -0
- package/src/lib/data-transfer-objects/src/passenger.persona.custom.dto.js +6 -1
- package/src/lib/data-transfer-objects/src/passenger.persona.custom.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/save.business.associate.payout.draft.dto.d.ts +25 -0
- package/src/lib/data-transfer-objects/src/save.business.associate.payout.draft.dto.js +59 -0
- package/src/lib/data-transfer-objects/src/save.business.associate.payout.draft.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.entry.dto.d.ts +44 -0
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.entry.dto.js +51 -0
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.entry.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.month.dto.d.ts +60 -0
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.month.dto.js +65 -0
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.month.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/update.global.config.dto.d.ts +10 -1
- package/src/lib/data-transfer-objects/src/update.global.config.dto.js +50 -2
- package/src/lib/data-transfer-objects/src/update.global.config.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/update.ltr.log.confirmation.config.dto.d.ts +6 -0
- package/src/lib/data-transfer-objects/src/update.ltr.log.confirmation.config.dto.js +20 -0
- package/src/lib/data-transfer-objects/src/update.ltr.log.confirmation.config.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/update.ltr.payout.rows.dto.d.ts +18 -0
- package/src/lib/data-transfer-objects/src/update.ltr.payout.rows.dto.js +20 -0
- package/src/lib/data-transfer-objects/src/update.ltr.payout.rows.dto.js.map +1 -0
- package/src/lib/enums/src/alert.command.types.js +1 -1
- package/src/lib/enums/src/alert.command.types.js.map +1 -1
- package/src/lib/enums/src/ba.payout.draft.enum.d.ts +13 -0
- package/src/lib/enums/src/ba.payout.draft.enum.js +15 -0
- package/src/lib/enums/src/ba.payout.draft.enum.js.map +1 -0
- package/src/lib/enums/src/city.state.mapping.js +2 -2
- package/src/lib/enums/src/command.type.enum.d.ts +12 -1
- package/src/lib/enums/src/command.type.enum.js +12 -1
- package/src/lib/enums/src/command.type.enum.js.map +1 -1
- package/src/lib/enums/src/index.d.ts +5 -0
- package/src/lib/enums/src/index.js +5 -0
- package/src/lib/enums/src/index.js.map +1 -1
- package/src/lib/enums/src/internal.alert.type.map.js +1 -0
- package/src/lib/enums/src/internal.alert.type.map.js.map +1 -1
- package/src/lib/enums/src/internal.alert.type.variable.map.js +7 -0
- package/src/lib/enums/src/internal.alert.type.variable.map.js.map +1 -1
- package/src/lib/enums/src/internal.alert.types.enum.d.ts +2 -1
- package/src/lib/enums/src/internal.alert.types.enum.js +1 -0
- package/src/lib/enums/src/internal.alert.types.enum.js.map +1 -1
- package/src/lib/enums/src/ltr.font.enum.d.ts +5 -0
- package/src/lib/enums/src/ltr.font.enum.js +7 -0
- package/src/lib/enums/src/ltr.font.enum.js.map +1 -0
- package/src/lib/enums/src/ltr.payout.enum.d.ts +67 -0
- package/src/lib/enums/src/ltr.payout.enum.js +74 -0
- package/src/lib/enums/src/ltr.payout.enum.js.map +1 -0
- package/src/lib/enums/src/model.enum.d.ts +7 -0
- package/src/lib/enums/src/model.enum.js +7 -0
- package/src/lib/enums/src/model.enum.js.map +1 -1
- package/src/lib/enums/src/others.default.data.js +5 -0
- package/src/lib/enums/src/others.default.data.js.map +1 -1
- package/src/lib/enums/src/otp.scope.enum.d.ts +16 -0
- package/src/lib/enums/src/otp.scope.enum.js +18 -0
- package/src/lib/enums/src/otp.scope.enum.js.map +1 -0
- package/src/lib/enums/src/query.type.enum.d.ts +6 -1
- package/src/lib/enums/src/query.type.enum.js +6 -1
- package/src/lib/enums/src/query.type.enum.js.map +1 -1
- package/src/lib/enums/src/report.command.types.js +1 -0
- package/src/lib/enums/src/report.command.types.js.map +1 -1
- package/src/lib/enums/src/retry.task.enum.d.ts +28 -0
- package/src/lib/enums/src/retry.task.enum.js +31 -0
- package/src/lib/enums/src/retry.task.enum.js.map +1 -0
- package/src/lib/enums/src/state.full.name.number.code.map.js +4 -0
- package/src/lib/enums/src/state.full.name.number.code.map.js.map +1 -1
- package/src/lib/enums/src/vendor.default.fields.json.js +19 -2
- package/src/lib/enums/src/vendor.default.fields.json.js.map +1 -1
- package/src/lib/models/src/auth.profile.model.d.ts +10 -0
- package/src/lib/models/src/auth.profile.model.js +6 -0
- package/src/lib/models/src/auth.profile.model.js.map +1 -1
- package/src/lib/models/src/ba.contract.model.d.ts +13 -0
- package/src/lib/models/src/ba.contract.model.js +2 -0
- package/src/lib/models/src/ba.contract.model.js.map +1 -1
- package/src/lib/models/src/ba.payout.draft.model.d.ts +77 -0
- package/src/lib/models/src/ba.payout.draft.model.js +31 -0
- package/src/lib/models/src/ba.payout.draft.model.js.map +1 -0
- package/src/lib/models/src/ba.payout.row.model.d.ts +35 -0
- package/src/lib/models/src/ba.payout.row.model.js +2 -0
- package/src/lib/models/src/ba.payout.row.model.js.map +1 -1
- package/src/lib/models/src/client.configuration.model.d.ts +9 -2
- package/src/lib/models/src/client.configuration.model.js +3 -0
- package/src/lib/models/src/client.configuration.model.js.map +1 -1
- package/src/lib/models/src/configurations.model.d.ts +18 -2
- package/src/lib/models/src/configurations.model.js +8 -0
- package/src/lib/models/src/configurations.model.js.map +1 -1
- package/src/lib/models/src/gst.model.d.ts +12 -2
- package/src/lib/models/src/gst.model.js +1 -0
- package/src/lib/models/src/gst.model.js.map +1 -1
- package/src/lib/models/src/index.d.ts +8 -0
- package/src/lib/models/src/index.js +8 -0
- package/src/lib/models/src/index.js.map +1 -1
- package/src/lib/models/src/ltr.log.confirmation.model.d.ts +30 -0
- package/src/lib/models/src/ltr.log.confirmation.model.js +15 -0
- package/src/lib/models/src/ltr.log.confirmation.model.js.map +1 -0
- package/src/lib/models/src/ltr.payout.model.d.ts +37 -2
- package/src/lib/models/src/ltr.payout.model.js +22 -0
- package/src/lib/models/src/ltr.payout.model.js.map +1 -1
- package/src/lib/models/src/ltr.payout.month.sign.off.model.d.ts +85 -0
- package/src/lib/models/src/ltr.payout.month.sign.off.model.js +28 -0
- package/src/lib/models/src/ltr.payout.month.sign.off.model.js.map +1 -0
- package/src/lib/models/src/ltr.payout.row.group.model.d.ts +73 -0
- package/src/lib/models/src/ltr.payout.row.group.model.js +25 -0
- package/src/lib/models/src/ltr.payout.row.group.model.js.map +1 -0
- package/src/lib/models/src/ltr.payout.row.image.model.d.ts +34 -0
- package/src/lib/models/src/ltr.payout.row.image.model.js +11 -0
- package/src/lib/models/src/ltr.payout.row.image.model.js.map +1 -0
- package/src/lib/models/src/ltr.vehicle.master.model.d.ts +2 -0
- package/src/lib/models/src/ltr.vehicle.master.model.js +1 -0
- package/src/lib/models/src/ltr.vehicle.master.model.js.map +1 -1
- package/src/lib/models/src/passenger.persona.model.d.ts +18 -2
- package/src/lib/models/src/passenger.persona.model.js +8 -0
- package/src/lib/models/src/passenger.persona.model.js.map +1 -1
- package/src/lib/models/src/retry.task.model.d.ts +56 -0
- package/src/lib/models/src/retry.task.model.js +26 -0
- package/src/lib/models/src/retry.task.model.js.map +1 -0
- package/src/lib/models/src/tds.config.activity.log.model.d.ts +34 -0
- package/src/lib/models/src/tds.config.activity.log.model.js +15 -0
- package/src/lib/models/src/tds.config.activity.log.model.js.map +1 -0
- package/src/lib/models/src/tds.config.model.d.ts +47 -0
- package/src/lib/models/src/tds.config.model.js +18 -0
- package/src/lib/models/src/tds.config.model.js.map +1 -0
- package/src/lib/models/src/vendor.persona.model.d.ts +6 -1
- package/src/lib/models/src/vendor.persona.model.js +2 -0
- package/src/lib/models/src/vendor.persona.model.js.map +1 -1
- package/src/lib/models/src/white.label.config.model.d.ts +6 -2
- package/src/lib/models/src/white.label.config.model.js +2 -0
- package/src/lib/models/src/white.label.config.model.js.map +1 -1
- package/src/lib/routes/src/command.registry.routes.d.ts +11 -0
- package/src/lib/routes/src/command.registry.routes.js +11 -0
- package/src/lib/routes/src/command.registry.routes.js.map +1 -1
- package/src/lib/routes/src/gatekeeper.routes.d.ts +2 -0
- package/src/lib/routes/src/gatekeeper.routes.js +2 -0
- package/src/lib/routes/src/gatekeeper.routes.js.map +1 -1
- package/src/lib/routes/src/query.service.routes.d.ts +6 -1
- package/src/lib/routes/src/query.service.routes.js +6 -1
- package/src/lib/routes/src/query.service.routes.js.map +1 -1
- package/src/lib/utilities/src/index.d.ts +4 -1
- package/src/lib/utilities/src/index.js +4 -1
- package/src/lib/utilities/src/index.js.map +1 -1
- package/src/lib/utilities/src/ltr.cycle.month.index.d.ts +1 -0
- package/src/lib/utilities/src/ltr.cycle.month.index.js +9 -0
- package/src/lib/utilities/src/ltr.cycle.month.index.js.map +1 -0
- package/src/lib/utilities/src/ltr.payout.row.key.d.ts +43 -0
- package/src/lib/utilities/src/ltr.payout.row.key.js +78 -0
- package/src/lib/utilities/src/ltr.payout.row.key.js.map +1 -0
- package/src/lib/utilities/src/parse.display.date.d.ts +16 -0
- package/src/lib/utilities/src/parse.display.date.js +43 -0
- package/src/lib/utilities/src/parse.display.date.js.map +1 -0
- package/src/lib/utilities/src/resolve.gst.state.d.ts +23 -0
- package/src/lib/utilities/src/resolve.gst.state.js +32 -0
- package/src/lib/utilities/src/resolve.gst.state.js.map +1 -0
- package/src/lib/view-models/src/public.config.d.ts +5 -1
- package/src/lib/view-models/src/successful.response.d.ts +17 -0
- package/src/lib/data-transfer-objects/src/get.ext.available.ratecards.dto.d.ts +0 -5
- package/src/lib/data-transfer-objects/src/get.ext.available.ratecards.dto.js +0 -19
- package/src/lib/data-transfer-objects/src/get.ext.available.ratecards.dto.js.map +0 -1
- package/src/lib/utilities/src/pick.latest.numbered.invoice.d.ts +0 -21
- package/src/lib/utilities/src/pick.latest.numbered.invoice.js +0 -52
- package/src/lib/utilities/src/pick.latest.numbered.invoice.js.map +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { LTRPayoutRow } from '../../models/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* A payout row's stable identity: the calendar date it covers, plus its shift
|
|
4
|
+
* where the contract has shifts.
|
|
5
|
+
*
|
|
6
|
+
* Derived from the row's own content rather than its position in
|
|
7
|
+
* `LTRPayout.ltrPayoutRows`. That matters because the array is re-sorted by
|
|
8
|
+
* date whenever an entry is added, so a row logged for an earlier date shifts
|
|
9
|
+
* the index of every row after it — an index captured in one response is not
|
|
10
|
+
* the same row in the next.
|
|
11
|
+
*
|
|
12
|
+
* This is already the uniqueness rule the system enforces: at most one row per
|
|
13
|
+
* date, or per (date, shift) on a shift contract. Two rows can therefore never
|
|
14
|
+
* share a key.
|
|
15
|
+
*
|
|
16
|
+
* Returns null when the row carries no parsable date, which only happens on
|
|
17
|
+
* malformed data; callers should fall back to the array index for those.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ltrPayoutRowKey(row: LTRPayoutRow): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* The instant a row starts, for ordering a booking's rows by date.
|
|
22
|
+
*
|
|
23
|
+
* Duty start first, garage start for garage-to-garage rows that record no
|
|
24
|
+
* separate duty window.
|
|
25
|
+
*/
|
|
26
|
+
export declare function ltrPayoutRowStart(row: LTRPayoutRow): Date | null;
|
|
27
|
+
/**
|
|
28
|
+
* A booking's rows in date order.
|
|
29
|
+
*
|
|
30
|
+
* The stored array is kept sorted so the charge calculation sees the duty as
|
|
31
|
+
* one continuous sequence — running KM and overtime both depend on the
|
|
32
|
+
* preceding row.
|
|
33
|
+
*/
|
|
34
|
+
export declare function sortLTRPayoutRowsByDate(rows: LTRPayoutRow[]): LTRPayoutRow[];
|
|
35
|
+
/**
|
|
36
|
+
* The first date in `newRows` that `existingRows` already occupies, as a label
|
|
37
|
+
* for the caller's error message — or null when there is no clash.
|
|
38
|
+
*
|
|
39
|
+
* Callers decide which rows count as "existing": adding an entry checks every
|
|
40
|
+
* stored row, while editing one checks only the OTHER entries, since the dates
|
|
41
|
+
* it currently holds are being released.
|
|
42
|
+
*/
|
|
43
|
+
export declare function findOverlappingLTRPayoutDate(existingRows: LTRPayoutRow[], newRows: LTRPayoutRow[]): string | null;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { LTRPayoutRowField } from '../../models/src/index';
|
|
2
|
+
import { firstParsableDisplayDate } from './parse.display.date';
|
|
3
|
+
/**
|
|
4
|
+
* A payout row's stable identity: the calendar date it covers, plus its shift
|
|
5
|
+
* where the contract has shifts.
|
|
6
|
+
*
|
|
7
|
+
* Derived from the row's own content rather than its position in
|
|
8
|
+
* `LTRPayout.ltrPayoutRows`. That matters because the array is re-sorted by
|
|
9
|
+
* date whenever an entry is added, so a row logged for an earlier date shifts
|
|
10
|
+
* the index of every row after it — an index captured in one response is not
|
|
11
|
+
* the same row in the next.
|
|
12
|
+
*
|
|
13
|
+
* This is already the uniqueness rule the system enforces: at most one row per
|
|
14
|
+
* date, or per (date, shift) on a shift contract. Two rows can therefore never
|
|
15
|
+
* share a key.
|
|
16
|
+
*
|
|
17
|
+
* Returns null when the row carries no parsable date, which only happens on
|
|
18
|
+
* malformed data; callers should fall back to the array index for those.
|
|
19
|
+
*/
|
|
20
|
+
export function ltrPayoutRowKey(row) {
|
|
21
|
+
const date = firstParsableDisplayDate([
|
|
22
|
+
row?.[LTRPayoutRowField.DutyStartDateTime],
|
|
23
|
+
row?.[LTRPayoutRowField.DutyStartDate],
|
|
24
|
+
row?.[LTRPayoutRowField.GarageStartDateTime],
|
|
25
|
+
row?.[LTRPayoutRowField.GarageStartDate],
|
|
26
|
+
]);
|
|
27
|
+
if (!date)
|
|
28
|
+
return null;
|
|
29
|
+
const datePart = `${String(date.getDate()).padStart(2, '0')}/${String(date.getMonth() + 1).padStart(2, '0')}/${date.getFullYear()}`;
|
|
30
|
+
const shift = row?.[LTRPayoutRowField.Shift];
|
|
31
|
+
return shift ? `${datePart}#${shift}` : datePart;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The instant a row starts, for ordering a booking's rows by date.
|
|
35
|
+
*
|
|
36
|
+
* Duty start first, garage start for garage-to-garage rows that record no
|
|
37
|
+
* separate duty window.
|
|
38
|
+
*/
|
|
39
|
+
export function ltrPayoutRowStart(row) {
|
|
40
|
+
return firstParsableDisplayDate([
|
|
41
|
+
row?.[LTRPayoutRowField.DutyStartDateTime],
|
|
42
|
+
row?.[LTRPayoutRowField.GarageStartDateTime],
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A booking's rows in date order.
|
|
47
|
+
*
|
|
48
|
+
* The stored array is kept sorted so the charge calculation sees the duty as
|
|
49
|
+
* one continuous sequence — running KM and overtime both depend on the
|
|
50
|
+
* preceding row.
|
|
51
|
+
*/
|
|
52
|
+
export function sortLTRPayoutRowsByDate(rows) {
|
|
53
|
+
return [...rows].sort((a, b) => (ltrPayoutRowStart(a)?.getTime() ?? 0) -
|
|
54
|
+
(ltrPayoutRowStart(b)?.getTime() ?? 0));
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The first date in `newRows` that `existingRows` already occupies, as a label
|
|
58
|
+
* for the caller's error message — or null when there is no clash.
|
|
59
|
+
*
|
|
60
|
+
* Callers decide which rows count as "existing": adding an entry checks every
|
|
61
|
+
* stored row, while editing one checks only the OTHER entries, since the dates
|
|
62
|
+
* it currently holds are being released.
|
|
63
|
+
*/
|
|
64
|
+
export function findOverlappingLTRPayoutDate(existingRows, newRows) {
|
|
65
|
+
const taken = new Set(existingRows
|
|
66
|
+
.map((row) => ltrPayoutRowKey(row))
|
|
67
|
+
.filter((key) => !!key));
|
|
68
|
+
for (const row of newRows) {
|
|
69
|
+
const key = ltrPayoutRowKey(row);
|
|
70
|
+
if (!key || !taken.has(key))
|
|
71
|
+
continue;
|
|
72
|
+
const shift = row?.[LTRPayoutRowField.Shift];
|
|
73
|
+
const date = row?.[LTRPayoutRowField.DutyStartDate] ?? key.split('#')[0];
|
|
74
|
+
return shift ? `${date} (shift ${shift})` : date;
|
|
75
|
+
}
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=ltr.payout.row.key.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ltr.payout.row.key.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/ltr.payout.row.key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAEhE;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,eAAe,CAAC,GAAiB;IAChD,MAAM,IAAI,GAAG,wBAAwB,CAAC;QACrC,GAAG,EAAE,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;QAC1C,GAAG,EAAE,CAAC,iBAAiB,CAAC,aAAa,CAAC;QACtC,GAAG,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,CAAC;QAC5C,GAAG,EAAE,CAAC,iBAAiB,CAAC,eAAe,CAAC;KACxC,CAAC,CAAC;IACH,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvB,MAAM,QAAQ,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,MAAM,CACpE,IAAI,CAAC,QAAQ,EAAE,GAAG,CAAC,CACnB,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;IAE3C,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;AAClD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,GAAiB;IAClD,OAAO,wBAAwB,CAAC;QAC/B,GAAG,EAAE,CAAC,iBAAiB,CAAC,iBAAiB,CAAC;QAC1C,GAAG,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,CAAC;KAC5C,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAAoB;IAC3D,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,CACpB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACR,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACtC,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC,CACvC,CAAC;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,4BAA4B,CAC3C,YAA4B,EAC5B,OAAuB;IAEvB,MAAM,KAAK,GAAG,IAAI,GAAG,CACpB,YAAY;SACV,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;SAClC,MAAM,CAAC,CAAC,GAAG,EAAiB,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CACvC,CAAC;IAEF,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC3B,MAAM,GAAG,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAEtC,MAAM,KAAK,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;QAC7C,MAAM,IAAI,GACT,GAAG,EAAE,CAAC,iBAAiB,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7D,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,WAAW,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAClD,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses the `dd/MM/yyyy` / `dd-MM-yyyy` date strings — with an optional
|
|
3
|
+
* `HH:mm` — that LTR payout rows are stored in.
|
|
4
|
+
*
|
|
5
|
+
* Payout rows keep dates as display strings rather than timestamps (the Excel
|
|
6
|
+
* upload writes them that way and the sheet round-trips them), so every reader
|
|
7
|
+
* has to parse them back. This is the single implementation: it previously
|
|
8
|
+
* existed as three copies that were free to drift apart.
|
|
9
|
+
*
|
|
10
|
+
* Returns null for anything unparseable, including calendar dates that do not
|
|
11
|
+
* exist — `Date` silently rolls 31/02/2026 forward to 03/03/2026, which would
|
|
12
|
+
* otherwise place a row in the wrong month.
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseDisplayDate(value: unknown): Date | null;
|
|
15
|
+
/** First parsable value, for rows that record the same moment several ways. */
|
|
16
|
+
export declare function firstParsableDisplayDate(candidates: unknown[]): Date | null;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses the `dd/MM/yyyy` / `dd-MM-yyyy` date strings — with an optional
|
|
3
|
+
* `HH:mm` — that LTR payout rows are stored in.
|
|
4
|
+
*
|
|
5
|
+
* Payout rows keep dates as display strings rather than timestamps (the Excel
|
|
6
|
+
* upload writes them that way and the sheet round-trips them), so every reader
|
|
7
|
+
* has to parse them back. This is the single implementation: it previously
|
|
8
|
+
* existed as three copies that were free to drift apart.
|
|
9
|
+
*
|
|
10
|
+
* Returns null for anything unparseable, including calendar dates that do not
|
|
11
|
+
* exist — `Date` silently rolls 31/02/2026 forward to 03/03/2026, which would
|
|
12
|
+
* otherwise place a row in the wrong month.
|
|
13
|
+
*/
|
|
14
|
+
export function parseDisplayDate(value) {
|
|
15
|
+
if (!value)
|
|
16
|
+
return null;
|
|
17
|
+
const match = String(value)
|
|
18
|
+
.trim()
|
|
19
|
+
.match(/^(\d{2})[-/](\d{2})[-/](\d{4})(?:\s+(\d{2}):(\d{2}))?$/);
|
|
20
|
+
if (!match)
|
|
21
|
+
return null;
|
|
22
|
+
const [, day, month, year, hour, minute] = match;
|
|
23
|
+
const date = new Date(Number(year), Number(month) - 1, Number(day), Number(hour ?? 0), Number(minute ?? 0));
|
|
24
|
+
if (isNaN(date.getTime()))
|
|
25
|
+
return null;
|
|
26
|
+
// Reject impossible calendar dates that Date silently rolls over.
|
|
27
|
+
if (date.getFullYear() !== Number(year) ||
|
|
28
|
+
date.getMonth() !== Number(month) - 1 ||
|
|
29
|
+
date.getDate() !== Number(day)) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return date;
|
|
33
|
+
}
|
|
34
|
+
/** First parsable value, for rows that record the same moment several ways. */
|
|
35
|
+
export function firstParsableDisplayDate(candidates) {
|
|
36
|
+
for (const candidate of candidates) {
|
|
37
|
+
const parsed = parseDisplayDate(candidate);
|
|
38
|
+
if (parsed)
|
|
39
|
+
return parsed;
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=parse.display.date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse.display.date.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/parse.display.date.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC9C,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;SACzB,IAAI,EAAE;SACN,KAAK,CAAC,wDAAwD,CAAC,CAAC;IAClE,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,MAAM,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC;IACjD,MAAM,IAAI,GAAG,IAAI,IAAI,CACpB,MAAM,CAAC,IAAI,CAAC,EACZ,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,EACjB,MAAM,CAAC,GAAG,CAAC,EACX,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EACjB,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC,CACnB,CAAC;IACF,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC;IAEvC,kEAAkE;IAClE,IACC,IAAI,CAAC,WAAW,EAAE,KAAK,MAAM,CAAC,IAAI,CAAC;QACnC,IAAI,CAAC,QAAQ,EAAE,KAAK,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC;QACrC,IAAI,CAAC,OAAO,EAAE,KAAK,MAAM,CAAC,GAAG,CAAC,EAC7B,CAAC;QACF,OAAO,IAAI,CAAC;IACb,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,wBAAwB,CAAC,UAAqB;IAC7D,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC3C,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;IAC3B,CAAC;IACD,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { City, State } from '../../enums/src/index';
|
|
2
|
+
/** The subset of a GST city entry this resolver needs. */
|
|
3
|
+
interface GstStateCitySource {
|
|
4
|
+
cityName?: City | null;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the state to store on a GST record.
|
|
8
|
+
*
|
|
9
|
+
* The state is captured on the billing form but was historically never persisted, leaving every
|
|
10
|
+
* consumer to re-derive it from either the GSTIN prefix or the city. Neither source exists for a
|
|
11
|
+
* GST-unregistered record saved without a city, so it is stored instead — and every write path
|
|
12
|
+
* that can change the GSTIN or the cities has to keep it current, or the stored value goes stale.
|
|
13
|
+
*
|
|
14
|
+
* Priority:
|
|
15
|
+
* 1. An explicit state. Only the billing form sends one, and it is also the only form that can
|
|
16
|
+
* omit a GSTIN, so it is the sole source for the case the column exists to cover.
|
|
17
|
+
* 2. The GSTIN's first two digits, which authoritatively encode the state.
|
|
18
|
+
* 3. The city mapping, for payloads carrying neither.
|
|
19
|
+
*
|
|
20
|
+
* Returns null when nothing resolves, which is a legitimate state for the row to be in.
|
|
21
|
+
*/
|
|
22
|
+
export declare const resolveGstState: (explicitState?: State | null, gstin?: string | null, cities?: GstStateCitySource[] | null) => State | null;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CityStateMapping, GstStatemapping } from '../../enums/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the state to store on a GST record.
|
|
4
|
+
*
|
|
5
|
+
* The state is captured on the billing form but was historically never persisted, leaving every
|
|
6
|
+
* consumer to re-derive it from either the GSTIN prefix or the city. Neither source exists for a
|
|
7
|
+
* GST-unregistered record saved without a city, so it is stored instead — and every write path
|
|
8
|
+
* that can change the GSTIN or the cities has to keep it current, or the stored value goes stale.
|
|
9
|
+
*
|
|
10
|
+
* Priority:
|
|
11
|
+
* 1. An explicit state. Only the billing form sends one, and it is also the only form that can
|
|
12
|
+
* omit a GSTIN, so it is the sole source for the case the column exists to cover.
|
|
13
|
+
* 2. The GSTIN's first two digits, which authoritatively encode the state.
|
|
14
|
+
* 3. The city mapping, for payloads carrying neither.
|
|
15
|
+
*
|
|
16
|
+
* Returns null when nothing resolves, which is a legitimate state for the row to be in.
|
|
17
|
+
*/
|
|
18
|
+
export const resolveGstState = (explicitState, gstin, cities) => {
|
|
19
|
+
if (explicitState)
|
|
20
|
+
return explicitState;
|
|
21
|
+
const prefix = gstin?.trim()?.slice(0, 2);
|
|
22
|
+
const fromGstin = prefix ? GstStatemapping[prefix] : undefined;
|
|
23
|
+
if (fromGstin)
|
|
24
|
+
return fromGstin;
|
|
25
|
+
// The legacy cityName/Address columns mirror cities[0] positionally, but for the state any
|
|
26
|
+
// populated city will do — a blank first entry should not lose a state we can still resolve.
|
|
27
|
+
const cityName = (cities ?? [])
|
|
28
|
+
.map((c) => c?.cityName)
|
|
29
|
+
.find((name) => Boolean(name));
|
|
30
|
+
return cityName ? (CityStateMapping[cityName] ?? null) : null;
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=resolve.gst.state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.gst.state.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/resolve.gst.state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,gBAAgB,EAAE,eAAe,EAAS,MAAM,uBAAuB,CAAC;AAOvF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC9B,aAA4B,EAC5B,KAAqB,EACrB,MAAoC,EACrB,EAAE;IACjB,IAAI,aAAa;QAAE,OAAO,aAAa,CAAC;IAExC,MAAM,MAAM,GAAG,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1C,MAAM,SAAS,GAAG,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/D,IAAI,SAAS;QAAE,OAAO,SAAS,CAAC;IAEhC,2FAA2F;IAC3F,6FAA6F;IAC7F,MAAM,QAAQ,GAAG,CAAC,MAAM,IAAI,EAAE,CAAC;SAC7B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC;SACvB,IAAI,CAAC,CAAC,IAAI,EAAgB,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAE9C,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/D,CAAC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LoginType, OrganizationTypeConfig } from '@autologix/shared/enums';
|
|
1
|
+
import { LoginType, LtrAppFont, OrganizationTypeConfig } from '@autologix/shared/enums';
|
|
2
2
|
import { ICarouselImage } from '../../models/src/white.label.config.model';
|
|
3
3
|
import { ILanguage } from '../../models/src/language.model';
|
|
4
4
|
export interface IPublicConfig {
|
|
@@ -39,4 +39,8 @@ export interface IPublicConfig {
|
|
|
39
39
|
carouselImages?: ICarouselImage[];
|
|
40
40
|
knowMoreUrl?: string;
|
|
41
41
|
backgroundImage?: string;
|
|
42
|
+
otpLength?: number;
|
|
43
|
+
primaryFont?: LtrAppFont;
|
|
44
|
+
ltrOtpLength?: number;
|
|
45
|
+
ltrAppFont?: LtrAppFont;
|
|
42
46
|
}
|
|
@@ -2,4 +2,21 @@ import { RequestProcessingStatus } from '../../enums/src/index';
|
|
|
2
2
|
export interface SuccessfulResponse<Data> {
|
|
3
3
|
data: Data;
|
|
4
4
|
status: RequestProcessingStatus.Success;
|
|
5
|
+
/**
|
|
6
|
+
* Optional note about the success itself — not an error.
|
|
7
|
+
*
|
|
8
|
+
* `UnsuccessfulResponse` has always carried `message`; this member did not,
|
|
9
|
+
* so a caller that narrowed a `RequestResponse<T>` on
|
|
10
|
+
* `status === Success` had no field to read even when the server had
|
|
11
|
+
* something to say. That bit AD-3227: the draft save reports Success while
|
|
12
|
+
* deliberately keeping the stored `validRows` over an empty incoming set,
|
|
13
|
+
* and the rows-less success payload gives the caller no other way to notice
|
|
14
|
+
* the divergence.
|
|
15
|
+
*
|
|
16
|
+
* Optional and additive, so every existing producer and consumer is
|
|
17
|
+
* unaffected. Use it for "we did what you asked, but here is something you
|
|
18
|
+
* should know", never for a failure — those still go through
|
|
19
|
+
* `UnsuccessfulResponse`.
|
|
20
|
+
*/
|
|
21
|
+
message?: string;
|
|
5
22
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { IsArray, IsOptional, IsString, IsUUID, } from 'class-validator';
|
|
3
|
-
export class GetExtAvailableRatecardsDTO {
|
|
4
|
-
constructor(obj) {
|
|
5
|
-
Object.assign(this, obj);
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
__decorate([
|
|
9
|
-
IsOptional(),
|
|
10
|
-
IsUUID(),
|
|
11
|
-
__metadata("design:type", String)
|
|
12
|
-
], GetExtAvailableRatecardsDTO.prototype, "contextId", void 0);
|
|
13
|
-
__decorate([
|
|
14
|
-
IsOptional(),
|
|
15
|
-
IsArray(),
|
|
16
|
-
IsString({ each: true }),
|
|
17
|
-
__metadata("design:type", Array)
|
|
18
|
-
], GetExtAvailableRatecardsDTO.prototype, "clientIds", void 0);
|
|
19
|
-
//# sourceMappingURL=get.ext.available.ratecards.dto.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get.ext.available.ratecards.dto.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/data-transfer-objects/src/get.ext.available.ratecards.dto.ts"],"names":[],"mappings":";AAAA,OAAO,EACN,OAAO,EAEP,UAAU,EACV,QAAQ,EACR,MAAM,GACN,MAAM,iBAAiB,CAAC;AAGzB,MAAM,OAAO,2BAA2B;IAUvC,YAAY,GAA0C;QACrD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;CACD;AAVA;IAFC,UAAU,EAAE;IACZ,MAAM,EAAE;;8DACU;AAKnB;IAHC,UAAU,EAAE;IACZ,OAAO,EAAE;IACT,QAAQ,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;8DACJ"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { INumberedInvoice } from '../../models/src/index';
|
|
2
|
-
/**
|
|
3
|
-
* Newest NumberedInvoice on a booking.
|
|
4
|
-
*
|
|
5
|
-
* `Request.numberedInvoices` is a plain @ManyToMany with no @OrderBy, so the
|
|
6
|
-
* array order is whatever the join-table scan yields and can change with the
|
|
7
|
-
* query plan. Callers reaching for `[0]` or `[length - 1]` were therefore
|
|
8
|
-
* picking an arbitrary invoice. That is invisible while a booking has exactly
|
|
9
|
-
* one, and surfaces as stale data the moment it has more — a rebill after
|
|
10
|
-
* modification, or the consolidated clone in
|
|
11
|
-
* `create.consolidated.invoice.handler`, both leave two attached.
|
|
12
|
-
*
|
|
13
|
-
* Ordered by `preparedAt` descending, with the id as a stable tiebreak for
|
|
14
|
-
* rows sharing a timestamp. Rows with no usable `preparedAt` sort last, so a
|
|
15
|
-
* legacy row without one never outranks a real invoice.
|
|
16
|
-
*
|
|
17
|
-
* Mirrors the explicit `ORDER BY ni.preparedAt` that
|
|
18
|
-
* `duties.query.raw.controller` and `bill.calculation.controller` already
|
|
19
|
-
* apply in SQL, for the callers that hold the relation in memory instead.
|
|
20
|
-
*/
|
|
21
|
-
export declare function pickLatestNumberedInvoice(invoices?: INumberedInvoice[] | null): INumberedInvoice | undefined;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { NumberedInvoiceField, } from '../../models/src/index';
|
|
2
|
-
/**
|
|
3
|
-
* Newest NumberedInvoice on a booking.
|
|
4
|
-
*
|
|
5
|
-
* `Request.numberedInvoices` is a plain @ManyToMany with no @OrderBy, so the
|
|
6
|
-
* array order is whatever the join-table scan yields and can change with the
|
|
7
|
-
* query plan. Callers reaching for `[0]` or `[length - 1]` were therefore
|
|
8
|
-
* picking an arbitrary invoice. That is invisible while a booking has exactly
|
|
9
|
-
* one, and surfaces as stale data the moment it has more — a rebill after
|
|
10
|
-
* modification, or the consolidated clone in
|
|
11
|
-
* `create.consolidated.invoice.handler`, both leave two attached.
|
|
12
|
-
*
|
|
13
|
-
* Ordered by `preparedAt` descending, with the id as a stable tiebreak for
|
|
14
|
-
* rows sharing a timestamp. Rows with no usable `preparedAt` sort last, so a
|
|
15
|
-
* legacy row without one never outranks a real invoice.
|
|
16
|
-
*
|
|
17
|
-
* Mirrors the explicit `ORDER BY ni.preparedAt` that
|
|
18
|
-
* `duties.query.raw.controller` and `bill.calculation.controller` already
|
|
19
|
-
* apply in SQL, for the callers that hold the relation in memory instead.
|
|
20
|
-
*/
|
|
21
|
-
export function pickLatestNumberedInvoice(invoices) {
|
|
22
|
-
if (!invoices?.length) {
|
|
23
|
-
return undefined;
|
|
24
|
-
}
|
|
25
|
-
let latest;
|
|
26
|
-
let latestAt = -Infinity;
|
|
27
|
-
for (const invoice of invoices) {
|
|
28
|
-
if (!invoice) {
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
const preparedAt = invoice[NumberedInvoiceField.PreparedAt];
|
|
32
|
-
const parsed = preparedAt ? new Date(preparedAt).getTime() : NaN;
|
|
33
|
-
const at = Number.isNaN(parsed) ? -Infinity : parsed;
|
|
34
|
-
if (!latest) {
|
|
35
|
-
latest = invoice;
|
|
36
|
-
latestAt = at;
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
// Compare ids only when the timestamps tie, so the winner is stable
|
|
40
|
-
// across query plans rather than dependent on array order.
|
|
41
|
-
const isNewer = at > latestAt ||
|
|
42
|
-
(at === latestAt &&
|
|
43
|
-
String(invoice[NumberedInvoiceField.NumberedInvoiceId] ?? '') >
|
|
44
|
-
String(latest[NumberedInvoiceField.NumberedInvoiceId] ?? ''));
|
|
45
|
-
if (isNewer) {
|
|
46
|
-
latest = invoice;
|
|
47
|
-
latestAt = at;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return latest;
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=pick.latest.numbered.invoice.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pick.latest.numbered.invoice.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/pick.latest.numbered.invoice.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,oBAAoB,GACpB,MAAM,wBAAwB,CAAC;AAEhC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,yBAAyB,CACxC,QAAoC;IAEpC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;QACvB,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,IAAI,MAAoC,CAAC;IACzC,IAAI,QAAQ,GAAG,CAAC,QAAQ,CAAC;IAEzB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAChC,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,SAAS;QACV,CAAC;QAED,MAAM,UAAU,GAAG,OAAO,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;QACjE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;QAErD,IAAI,CAAC,MAAM,EAAE,CAAC;YACb,MAAM,GAAG,OAAO,CAAC;YACjB,QAAQ,GAAG,EAAE,CAAC;YACd,SAAS;QACV,CAAC;QAED,oEAAoE;QACpE,2DAA2D;QAC3D,MAAM,OAAO,GACZ,EAAE,GAAG,QAAQ;YACb,CAAC,EAAE,KAAK,QAAQ;gBACf,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,IAAI,EAAE,CAAC;oBAC5D,MAAM,CACL,MAAM,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,IAAI,EAAE,CACpD,CAAC,CAAC;QAEN,IAAI,OAAO,EAAE,CAAC;YACb,MAAM,GAAG,OAAO,CAAC;YACjB,QAAQ,GAAG,EAAE,CAAC;QACf,CAAC;IACF,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
|