@autologix-engineering/shared 1.2.378 → 1.2.380
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/index.d.ts +0 -1
- package/src/index.js +0 -1
- package/src/index.js.map +1 -1
- package/src/lib/commands/src/generate.pdf.invoice.d.ts +1 -0
- package/src/lib/commands/src/generate.pdf.invoice.js.map +1 -1
- package/src/lib/contract-state/src/index.d.ts +0 -2
- package/src/lib/contract-state/src/index.js +0 -2
- package/src/lib/contract-state/src/index.js.map +1 -1
- package/src/lib/data-transfer-objects/src/calculate.non.pool.ltr.invoice.data.dto.d.ts +0 -1
- package/src/lib/data-transfer-objects/src/calculate.non.pool.ltr.invoice.data.dto.js +0 -5
- 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 +0 -1
- package/src/lib/data-transfer-objects/src/command/add.ltr.vehicle.master.dto.js +0 -5
- 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/process.ext.request.trip.sheet.dto.d.ts +0 -1
- package/src/lib/data-transfer-objects/src/command/process.ext.request.trip.sheet.dto.js +1 -8
- package/src/lib/data-transfer-objects/src/command/process.ext.request.trip.sheet.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/command/update.client.persona.contract.file.dto.d.ts +0 -6
- package/src/lib/data-transfer-objects/src/command/update.client.persona.contract.file.dto.js +1 -6
- package/src/lib/data-transfer-objects/src/command/update.client.persona.contract.file.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/command/update.contract.terms.dto.d.ts +0 -8
- package/src/lib/data-transfer-objects/src/command/update.contract.terms.dto.js +1 -6
- package/src/lib/data-transfer-objects/src/command/update.contract.terms.dto.js.map +1 -1
- 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 +0 -1
- package/src/lib/data-transfer-objects/src/command/update.ltr.request.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/create.consolidated.invoice.dto.d.ts +0 -4
- package/src/lib/data-transfer-objects/src/create.consolidated.invoice.dto.js +1 -21
- package/src/lib/data-transfer-objects/src/create.consolidated.invoice.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/create.dispatch.dto.d.ts +0 -4
- package/src/lib/data-transfer-objects/src/create.dispatch.dto.js +1 -21
- package/src/lib/data-transfer-objects/src/create.dispatch.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/create.report.dto.js +1 -1
- package/src/lib/data-transfer-objects/src/create.report.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/duties.query.dto.d.ts +0 -14
- package/src/lib/data-transfer-objects/src/duties.query.dto.js +0 -5
- 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 +0 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/create.onboarding.user.dto.js +1 -8
- 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.user.by.phone.dto.d.ts +0 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/get.user.by.phone.dto.js +1 -8
- 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 +0 -2
- package/src/lib/data-transfer-objects/src/gatekeeper/index.js +0 -2
- 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 +0 -72
- package/src/lib/data-transfer-objects/src/gatekeeper/send.email.login.otp.dto.js +1 -36
- package/src/lib/data-transfer-objects/src/gatekeeper/send.email.login.otp.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/get.ext.available.ratecards.dto.d.ts +5 -0
- package/src/lib/data-transfer-objects/src/get.ext.available.ratecards.dto.js +19 -0
- package/src/lib/data-transfer-objects/src/get.ext.available.ratecards.dto.js.map +1 -0
- package/src/lib/data-transfer-objects/src/get.ltr.vehicle.master.dto.d.ts +0 -1
- package/src/lib/data-transfer-objects/src/get.ltr.vehicle.master.dto.js +2 -9
- package/src/lib/data-transfer-objects/src/get.ltr.vehicle.master.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/gst.dto.d.ts +4 -9
- package/src/lib/data-transfer-objects/src/gst.dto.js +1 -9
- package/src/lib/data-transfer-objects/src/gst.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/index.d.ts +3 -19
- package/src/lib/data-transfer-objects/src/index.js +3 -19
- 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 +0 -1
- package/src/lib/data-transfer-objects/src/passenger.persona.custom.dto.js +1 -6
- package/src/lib/data-transfer-objects/src/passenger.persona.custom.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/send.chauffeur.sms.dto.d.ts +2 -2
- package/src/lib/data-transfer-objects/src/send.chauffeur.sms.dto.js +7 -1
- package/src/lib/data-transfer-objects/src/send.chauffeur.sms.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/submit.ltr.payout.rows.dto.d.ts +0 -15
- package/src/lib/data-transfer-objects/src/submit.ltr.payout.rows.dto.js +0 -5
- package/src/lib/data-transfer-objects/src/submit.ltr.payout.rows.dto.js.map +1 -1
- package/src/lib/data-transfer-objects/src/update.global.config.dto.d.ts +1 -5
- package/src/lib/data-transfer-objects/src/update.global.config.dto.js +1 -23
- package/src/lib/data-transfer-objects/src/update.global.config.dto.js.map +1 -1
- 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/city.state.mapping.js +2 -2
- package/src/lib/enums/src/command.type.enum.d.ts +1 -8
- package/src/lib/enums/src/command.type.enum.js +1 -8
- package/src/lib/enums/src/command.type.enum.js.map +1 -1
- package/src/lib/enums/src/index.d.ts +1 -7
- package/src/lib/enums/src/index.js +1 -7
- package/src/lib/enums/src/index.js.map +1 -1
- package/src/lib/enums/src/model.enum.d.ts +1 -9
- package/src/lib/enums/src/model.enum.js +0 -8
- package/src/lib/enums/src/model.enum.js.map +1 -1
- package/src/lib/enums/src/others.default.data.js +0 -5
- package/src/lib/enums/src/others.default.data.js.map +1 -1
- package/src/lib/enums/src/query.type.enum.d.ts +2 -12
- package/src/lib/enums/src/query.type.enum.js +1 -12
- package/src/lib/enums/src/query.type.enum.js.map +1 -1
- package/src/lib/enums/src/report.module.type.enum.d.ts +1 -5
- package/src/lib/enums/src/report.module.type.enum.js +0 -4
- package/src/lib/enums/src/report.module.type.enum.js.map +1 -1
- package/src/lib/enums/src/state.full.name.number.code.map.js +0 -4
- package/src/lib/enums/src/state.full.name.number.code.map.js.map +1 -1
- package/src/lib/enums/src/trip.file.type.enum.d.ts +1 -2
- package/src/lib/enums/src/trip.file.type.enum.js +0 -1
- package/src/lib/enums/src/trip.file.type.enum.js.map +1 -1
- package/src/lib/models/src/auth.profile.model.d.ts +0 -13
- package/src/lib/models/src/auth.profile.model.js +0 -7
- package/src/lib/models/src/auth.profile.model.js.map +1 -1
- package/src/lib/models/src/ba.payout.row.model.d.ts +0 -24
- package/src/lib/models/src/ba.payout.row.model.js.map +1 -1
- package/src/lib/models/src/client.configuration.model.d.ts +1 -12
- package/src/lib/models/src/client.configuration.model.js +0 -5
- package/src/lib/models/src/client.configuration.model.js.map +1 -1
- package/src/lib/models/src/configurations.model.d.ts +2 -22
- package/src/lib/models/src/configurations.model.js +0 -15
- package/src/lib/models/src/configurations.model.js.map +1 -1
- package/src/lib/models/src/gst.model.d.ts +2 -12
- package/src/lib/models/src/gst.model.js +0 -1
- package/src/lib/models/src/gst.model.js.map +1 -1
- package/src/lib/models/src/index.d.ts +1 -10
- package/src/lib/models/src/index.js +1 -10
- package/src/lib/models/src/index.js.map +1 -1
- package/src/lib/models/src/ltr.payout.model.d.ts +2 -37
- package/src/lib/models/src/ltr.payout.model.js +0 -22
- package/src/lib/models/src/ltr.payout.model.js.map +1 -1
- package/src/lib/models/src/ltr.vehicle.master.model.d.ts +0 -2
- package/src/lib/models/src/ltr.vehicle.master.model.js +0 -1
- package/src/lib/models/src/ltr.vehicle.master.model.js.map +1 -1
- package/src/lib/models/src/passenger.persona.model.d.ts +2 -18
- package/src/lib/models/src/passenger.persona.model.js +0 -8
- package/src/lib/models/src/passenger.persona.model.js.map +1 -1
- package/src/lib/models/src/vehicle.association.file.model.d.ts +29 -4
- package/src/lib/models/src/vehicle.association.file.model.js +27 -3
- package/src/lib/models/src/vehicle.association.file.model.js.map +1 -1
- package/src/lib/models/src/vehicle.verification.log.model.d.ts +16 -1
- package/src/lib/models/src/vehicle.verification.log.model.js +15 -0
- package/src/lib/models/src/vehicle.verification.log.model.js.map +1 -1
- package/src/lib/models/src/white.label.config.model.d.ts +2 -6
- package/src/lib/models/src/white.label.config.model.js +0 -2
- package/src/lib/models/src/white.label.config.model.js.map +1 -1
- package/src/lib/routes/src/command.registry.routes.d.ts +0 -7
- package/src/lib/routes/src/command.registry.routes.js +0 -7
- package/src/lib/routes/src/command.registry.routes.js.map +1 -1
- package/src/lib/routes/src/gatekeeper.routes.d.ts +0 -2
- package/src/lib/routes/src/gatekeeper.routes.js +0 -2
- package/src/lib/routes/src/gatekeeper.routes.js.map +1 -1
- package/src/lib/routes/src/query.service.routes.d.ts +1 -11
- package/src/lib/routes/src/query.service.routes.js +1 -12
- package/src/lib/routes/src/query.service.routes.js.map +1 -1
- package/src/lib/utilities/src/index.d.ts +3 -8
- package/src/lib/utilities/src/index.js +3 -8
- package/src/lib/utilities/src/index.js.map +1 -1
- package/src/lib/utilities/src/insurer.match.d.ts +45 -0
- package/src/lib/utilities/src/insurer.match.js +55 -0
- package/src/lib/utilities/src/insurer.match.js.map +1 -0
- package/src/lib/utilities/src/invoice.generation.alert.util.d.ts +0 -1
- package/src/lib/utilities/src/invoice.generation.alert.util.js +2 -7
- package/src/lib/utilities/src/invoice.generation.alert.util.js.map +1 -1
- package/src/lib/utilities/src/pick.latest.numbered.invoice.d.ts +21 -0
- package/src/lib/utilities/src/pick.latest.numbered.invoice.js +52 -0
- package/src/lib/utilities/src/pick.latest.numbered.invoice.js.map +1 -0
- package/src/lib/view-models/src/index.d.ts +0 -2
- package/src/lib/view-models/src/index.js +0 -2
- package/src/lib/view-models/src/index.js.map +1 -1
- package/src/lib/view-models/src/public.config.d.ts +1 -5
- package/src/lib/contract-state/src/contract.date.change.display.d.ts +0 -27
- package/src/lib/contract-state/src/contract.date.change.display.js +0 -47
- package/src/lib/contract-state/src/contract.date.change.display.js.map +0 -1
- package/src/lib/contract-state/src/contract.date.change.window.d.ts +0 -63
- package/src/lib/contract-state/src/contract.date.change.window.js +0 -85
- package/src/lib/contract-state/src/contract.date.change.window.js.map +0 -1
- package/src/lib/data-transfer-objects/src/add.ltr.payout.rows.dto.d.ts +0 -86
- package/src/lib/data-transfer-objects/src/add.ltr.payout.rows.dto.js +0 -153
- package/src/lib/data-transfer-objects/src/add.ltr.payout.rows.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/check.vehicle.allocation.conflicts.dto.d.ts +0 -19
- package/src/lib/data-transfer-objects/src/check.vehicle.allocation.conflicts.dto.js +0 -38
- package/src/lib/data-transfer-objects/src/check.vehicle.allocation.conflicts.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/get.registered.user.ltr.dto.d.ts +0 -7
- package/src/lib/data-transfer-objects/src/gatekeeper/get.registered.user.ltr.dto.js +0 -21
- package/src/lib/data-transfer-objects/src/gatekeeper/get.registered.user.ltr.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/gatekeeper/send.ltr.sign.off.otp.dto.d.ts +0 -17
- package/src/lib/data-transfer-objects/src/gatekeeper/send.ltr.sign.off.otp.dto.js +0 -29
- package/src/lib/data-transfer-objects/src/gatekeeper/send.ltr.sign.off.otp.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/get.contract.date.changes.dto.d.ts +0 -59
- package/src/lib/data-transfer-objects/src/get.contract.date.changes.dto.js +0 -98
- package/src/lib/data-transfer-objects/src/get.contract.date.changes.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/get.ext.rate.card.dto.d.ts +0 -40
- package/src/lib/data-transfer-objects/src/get.ext.rate.card.dto.js +0 -75
- package/src/lib/data-transfer-objects/src/get.ext.rate.card.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/get.ltr.booking.day.wise.logs.dto.d.ts +0 -29
- package/src/lib/data-transfer-objects/src/get.ltr.booking.day.wise.logs.dto.js +0 -32
- package/src/lib/data-transfer-objects/src/get.ltr.booking.day.wise.logs.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/get.ltr.driver.bookings.dto.d.ts +0 -5
- package/src/lib/data-transfer-objects/src/get.ltr.driver.bookings.dto.js +0 -17
- package/src/lib/data-transfer-objects/src/get.ltr.driver.bookings.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.logs.dto.d.ts +0 -18
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.logs.dto.js +0 -33
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.logs.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.sign.off.preview.dto.d.ts +0 -24
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.sign.off.preview.dto.js +0 -33
- package/src/lib/data-transfer-objects/src/get.ltr.driver.monthly.sign.off.preview.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/get.ltr.driver.payout.rows.dto.d.ts +0 -79
- package/src/lib/data-transfer-objects/src/get.ltr.driver.payout.rows.dto.js +0 -58
- package/src/lib/data-transfer-objects/src/get.ltr.driver.payout.rows.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/get.ltr.payout.row.audit.dto.d.ts +0 -31
- package/src/lib/data-transfer-objects/src/get.ltr.payout.row.audit.dto.js +0 -42
- package/src/lib/data-transfer-objects/src/get.ltr.payout.row.audit.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/get.ltr.sign.off.config.dto.d.ts +0 -20
- package/src/lib/data-transfer-objects/src/get.ltr.sign.off.config.dto.js +0 -20
- package/src/lib/data-transfer-objects/src/get.ltr.sign.off.config.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.entry.dto.d.ts +0 -44
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.entry.dto.js +0 -51
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.entry.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.month.dto.d.ts +0 -78
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.month.dto.js +0 -71
- package/src/lib/data-transfer-objects/src/sign.off.ltr.payout.month.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/update.ltr.log.confirmation.config.dto.d.ts +0 -6
- package/src/lib/data-transfer-objects/src/update.ltr.log.confirmation.config.dto.js +0 -20
- package/src/lib/data-transfer-objects/src/update.ltr.log.confirmation.config.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/update.ltr.payout.rows.dto.d.ts +0 -18
- package/src/lib/data-transfer-objects/src/update.ltr.payout.rows.dto.js +0 -20
- package/src/lib/data-transfer-objects/src/update.ltr.payout.rows.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/update.pickup.detection.config.dto.d.ts +0 -7
- package/src/lib/data-transfer-objects/src/update.pickup.detection.config.dto.js +0 -22
- package/src/lib/data-transfer-objects/src/update.pickup.detection.config.dto.js.map +0 -1
- package/src/lib/data-transfer-objects/src/update.vehicle.allocation.conflict.window.dto.d.ts +0 -15
- package/src/lib/data-transfer-objects/src/update.vehicle.allocation.conflict.window.dto.js +0 -29
- package/src/lib/data-transfer-objects/src/update.vehicle.allocation.conflict.window.dto.js.map +0 -1
- package/src/lib/enums/src/ltr.font.enum.d.ts +0 -5
- package/src/lib/enums/src/ltr.font.enum.js +0 -7
- package/src/lib/enums/src/ltr.font.enum.js.map +0 -1
- package/src/lib/enums/src/ltr.payout.enum.d.ts +0 -67
- package/src/lib/enums/src/ltr.payout.enum.js +0 -74
- package/src/lib/enums/src/ltr.payout.enum.js.map +0 -1
- package/src/lib/enums/src/otp.scope.enum.d.ts +0 -16
- package/src/lib/enums/src/otp.scope.enum.js +0 -18
- package/src/lib/enums/src/otp.scope.enum.js.map +0 -1
- package/src/lib/enums/src/pickup.detection.mode.enum.d.ts +0 -5
- package/src/lib/enums/src/pickup.detection.mode.enum.js +0 -7
- package/src/lib/enums/src/pickup.detection.mode.enum.js.map +0 -1
- package/src/lib/enums/src/retry.task.enum.d.ts +0 -28
- package/src/lib/enums/src/retry.task.enum.js +0 -31
- package/src/lib/enums/src/retry.task.enum.js.map +0 -1
- package/src/lib/enums/src/vehicle.allocation.conflict.enum.d.ts +0 -65
- package/src/lib/enums/src/vehicle.allocation.conflict.enum.js +0 -71
- package/src/lib/enums/src/vehicle.allocation.conflict.enum.js.map +0 -1
- package/src/lib/models/src/client.contract.date.change.model.d.ts +0 -80
- package/src/lib/models/src/client.contract.date.change.model.js +0 -25
- package/src/lib/models/src/client.contract.date.change.model.js.map +0 -1
- package/src/lib/models/src/configurations.activity.log.model.d.ts +0 -42
- package/src/lib/models/src/configurations.activity.log.model.js +0 -15
- package/src/lib/models/src/configurations.activity.log.model.js.map +0 -1
- package/src/lib/models/src/ltr.log.confirmation.model.d.ts +0 -30
- package/src/lib/models/src/ltr.log.confirmation.model.js +0 -15
- package/src/lib/models/src/ltr.log.confirmation.model.js.map +0 -1
- package/src/lib/models/src/ltr.payout.month.sign.off.model.d.ts +0 -85
- package/src/lib/models/src/ltr.payout.month.sign.off.model.js +0 -28
- package/src/lib/models/src/ltr.payout.month.sign.off.model.js.map +0 -1
- package/src/lib/models/src/ltr.payout.row.audit.model.d.ts +0 -44
- package/src/lib/models/src/ltr.payout.row.audit.model.js +0 -22
- package/src/lib/models/src/ltr.payout.row.audit.model.js.map +0 -1
- package/src/lib/models/src/ltr.payout.row.group.model.d.ts +0 -73
- package/src/lib/models/src/ltr.payout.row.group.model.js +0 -25
- package/src/lib/models/src/ltr.payout.row.group.model.js.map +0 -1
- package/src/lib/models/src/ltr.payout.row.image.model.d.ts +0 -34
- package/src/lib/models/src/ltr.payout.row.image.model.js +0 -11
- package/src/lib/models/src/ltr.payout.row.image.model.js.map +0 -1
- package/src/lib/models/src/ltr.sign.off.otp.model.d.ts +0 -40
- package/src/lib/models/src/ltr.sign.off.otp.model.js +0 -17
- package/src/lib/models/src/ltr.sign.off.otp.model.js.map +0 -1
- package/src/lib/models/src/retry.task.model.d.ts +0 -56
- package/src/lib/models/src/retry.task.model.js +0 -26
- package/src/lib/models/src/retry.task.model.js.map +0 -1
- package/src/lib/utilities/src/ba.payout.workshop.days.d.ts +0 -77
- package/src/lib/utilities/src/ba.payout.workshop.days.js +0 -109
- package/src/lib/utilities/src/ba.payout.workshop.days.js.map +0 -1
- package/src/lib/utilities/src/financial.year.d.ts +0 -83
- package/src/lib/utilities/src/financial.year.js +0 -145
- package/src/lib/utilities/src/financial.year.js.map +0 -1
- package/src/lib/utilities/src/ltr.cycle.month.index.d.ts +0 -14
- package/src/lib/utilities/src/ltr.cycle.month.index.js +0 -22
- package/src/lib/utilities/src/ltr.cycle.month.index.js.map +0 -1
- package/src/lib/utilities/src/ltr.payout.row.key.d.ts +0 -43
- package/src/lib/utilities/src/ltr.payout.row.key.js +0 -78
- package/src/lib/utilities/src/ltr.payout.row.key.js.map +0 -1
- package/src/lib/utilities/src/normalize.phone.number.d.ts +0 -17
- package/src/lib/utilities/src/normalize.phone.number.js +0 -45
- package/src/lib/utilities/src/normalize.phone.number.js.map +0 -1
- package/src/lib/utilities/src/parse.display.date.d.ts +0 -16
- package/src/lib/utilities/src/parse.display.date.js +0 -43
- package/src/lib/utilities/src/parse.display.date.js.map +0 -1
- package/src/lib/utilities/src/resolve.gst.state.d.ts +0 -23
- package/src/lib/utilities/src/resolve.gst.state.js +0 -38
- package/src/lib/utilities/src/resolve.gst.state.js.map +0 -1
- package/src/lib/view-models/src/ext.rate.card.d.ts +0 -114
- package/src/lib/view-models/src/ext.rate.card.js +0 -9
- package/src/lib/view-models/src/ext.rate.card.js.map +0 -1
- package/src/lib/view-models/src/vehicle.allocation.conflict.d.ts +0 -28
- package/src/lib/view-models/src/vehicle.allocation.conflict.js +0 -2
- package/src/lib/view-models/src/vehicle.allocation.conflict.js.map +0 -1
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AD-3288 — workshop (maintenance) days excluded from the BA payout
|
|
3
|
-
* min-working-days penalty.
|
|
4
|
-
*
|
|
5
|
-
* A BA whose vehicle sat in the workshop could not run duties on those days,
|
|
6
|
-
* so charging the per-day "worked less than N days" penalty for them is wrong.
|
|
7
|
-
* When a maintenance Work Order exists for the BA's vehicle in the payout
|
|
8
|
-
* month, the workshop days it covers are taken off the minimum before the
|
|
9
|
-
* shortfall is priced.
|
|
10
|
-
*
|
|
11
|
-
* Everything here is pure integer arithmetic over IST-midnight day
|
|
12
|
-
* timestamps. The caller normalises dates to IST calendar days with the SAME
|
|
13
|
-
* helper it uses for on-duty days (`normalizeIstCalendarDay` in the payout
|
|
14
|
-
* controller) so the two day sets are directly comparable — a workshop day and
|
|
15
|
-
* a duty day for the same calendar date always carry the same timestamp.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* NRT type that marks a workshop visit raised against a Work Order. The Work
|
|
19
|
-
* Order field on the NRT form is only shown for this type, and an NRT created
|
|
20
|
-
* from a Work Order is forced to it, so "maintenance work order" is exactly
|
|
21
|
-
* "NRT of this type with a Work Order linked". NrtType is a per-context master
|
|
22
|
-
* (free text), hence a string constant and a case-insensitive comparison
|
|
23
|
-
* rather than an enum.
|
|
24
|
-
*/
|
|
25
|
-
export const MAINTENANCE_NRT_TYPE = 'Maintenance';
|
|
26
|
-
const DAY_MS = 24 * 60 * 60 * 1000;
|
|
27
|
-
const pushUnique = (target, value) => {
|
|
28
|
-
if (!value)
|
|
29
|
-
return;
|
|
30
|
-
if (!target.includes(value))
|
|
31
|
-
target.push(value);
|
|
32
|
-
};
|
|
33
|
-
/**
|
|
34
|
-
* Workshop days for one contract, clipped to `windowStartTs..windowEndTs`
|
|
35
|
-
* (the payout month ∩ contract window the penalty already uses).
|
|
36
|
-
*
|
|
37
|
-
* Overlap rule: only days INSIDE the window are returned, so an NRT that
|
|
38
|
-
* started in the previous month or runs into the next one contributes just
|
|
39
|
-
* its in-window days. Overlapping / duplicate NRTs collapse onto one entry per
|
|
40
|
-
* calendar day, so five one-day NRTs raised for the same date exclude one day,
|
|
41
|
-
* not five.
|
|
42
|
-
*/
|
|
43
|
-
export function computeWorkshopDayExclusion(periods, windowStartTs, windowEndTs, onDutyDayTimestamps) {
|
|
44
|
-
const empty = { excludedDays: 0, days: [] };
|
|
45
|
-
if (!Array.isArray(periods) || periods.length === 0)
|
|
46
|
-
return empty;
|
|
47
|
-
if (!Number.isFinite(windowStartTs) || !Number.isFinite(windowEndTs)) {
|
|
48
|
-
return empty;
|
|
49
|
-
}
|
|
50
|
-
if (windowStartTs > windowEndTs)
|
|
51
|
-
return empty;
|
|
52
|
-
const dutyDays = new Set();
|
|
53
|
-
for (const ts of onDutyDayTimestamps ?? []) {
|
|
54
|
-
if (Number.isFinite(ts))
|
|
55
|
-
dutyDays.add(ts);
|
|
56
|
-
}
|
|
57
|
-
const dayMap = new Map();
|
|
58
|
-
for (const period of periods) {
|
|
59
|
-
if (!period)
|
|
60
|
-
continue;
|
|
61
|
-
const { startDayTs, endDayTs } = period;
|
|
62
|
-
if (!Number.isFinite(startDayTs) || !Number.isFinite(endDayTs)) {
|
|
63
|
-
continue;
|
|
64
|
-
}
|
|
65
|
-
// Bad data (return before start) contributes nothing rather than
|
|
66
|
-
// looping forever or silently crediting the start day.
|
|
67
|
-
if (startDayTs > endDayTs)
|
|
68
|
-
continue;
|
|
69
|
-
const clipStart = Math.max(startDayTs, windowStartTs);
|
|
70
|
-
const clipEnd = Math.min(endDayTs, windowEndTs);
|
|
71
|
-
if (clipStart > clipEnd)
|
|
72
|
-
continue;
|
|
73
|
-
for (let ts = clipStart; ts <= clipEnd; ts += DAY_MS) {
|
|
74
|
-
let day = dayMap.get(ts);
|
|
75
|
-
if (!day) {
|
|
76
|
-
day = {
|
|
77
|
-
dayTs: ts,
|
|
78
|
-
nrtNumbers: [],
|
|
79
|
-
workOrderNumbers: [],
|
|
80
|
-
hasDuty: dutyDays.has(ts),
|
|
81
|
-
};
|
|
82
|
-
dayMap.set(ts, day);
|
|
83
|
-
}
|
|
84
|
-
pushUnique(day.nrtNumbers, period.nrtNumber);
|
|
85
|
-
pushUnique(day.workOrderNumbers, period.workOrderNumber);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
const days = Array.from(dayMap.values()).sort((a, b) => a.dayTs - b.dayTs);
|
|
89
|
-
const excludedDays = days.filter((d) => !d.hasDuty).length;
|
|
90
|
-
return { excludedDays, days };
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Penalty days for the min-working-days penalty, after workshop exclusion.
|
|
94
|
-
*
|
|
95
|
-
* effectiveMinimum = minWorkingDays − excludedWorkshopDays (floored at 0)
|
|
96
|
-
* penaltyDays = effectiveMinimum − actualWorkingDays (floored at 0)
|
|
97
|
-
*
|
|
98
|
-
* With no workshop days this is the untouched original rule
|
|
99
|
-
* (minWorkingDays − actualWorkingDays), so a BA with no maintenance Work
|
|
100
|
-
* Order in the month is unaffected.
|
|
101
|
-
*/
|
|
102
|
-
export function computeMinWorkingDaysPenaltyDays(minWorkingDays, actualWorkingDays, excludedWorkshopDays = 0) {
|
|
103
|
-
const minimum = Number(minWorkingDays) || 0;
|
|
104
|
-
const worked = Number(actualWorkingDays) || 0;
|
|
105
|
-
const excluded = Number(excludedWorkshopDays) || 0;
|
|
106
|
-
const effectiveMinimum = Math.max(0, minimum - Math.max(0, excluded));
|
|
107
|
-
return Math.max(0, effectiveMinimum - worked);
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=ba.payout.workshop.days.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ba.payout.workshop.days.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/ba.payout.workshop.days.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAmClD,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAEnC,MAAM,UAAU,GAAG,CAAC,MAAgB,EAAE,KAAqB,EAAQ,EAAE;IACpE,IAAI,CAAC,KAAK;QAAE,OAAO;IACnB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACjD,CAAC,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,UAAU,2BAA2B,CAC1C,OAA+B,EAC/B,aAAqB,EACrB,WAAmB,EACnB,mBAAqC;IAErC,MAAM,KAAK,GAAgC,EAAE,YAAY,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;IACzE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAClE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;QACtE,OAAO,KAAK,CAAC;IACd,CAAC;IACD,IAAI,aAAa,GAAG,WAAW;QAAE,O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
|
4
|
-
* A financial year runs 1 April 00:00:00.000 IST to 31 March 23:59:59.999 IST.
|
|
5
|
-
* Every boundary here is an IST boundary expressed as a UTC instant, because
|
|
6
|
-
* that is how the database stores time: TimePeriod.startDate for September 2026
|
|
7
|
-
* is 2026-08-31T18:30:00Z, i.e. 1 September 00:00 IST. Deriving the month with
|
|
8
|
-
* plain `getMonth()` on the server's local clock would put every payout period
|
|
9
|
-
* that starts at 18:30 UTC into the previous month on any machine running UTC —
|
|
10
|
-
* a whole column of the RM schedule shifted by one.
|
|
11
|
-
*
|
|
12
|
-
* Written for AD-3098 (BA Retention Money schedule) and deliberately kept free
|
|
13
|
-
* of anything RM-specific so AD-3097 (Security Deposit schedule), which has the
|
|
14
|
-
* same April–March, one-column-group-per-month shape, can use it unchanged.
|
|
15
|
-
*/
|
|
16
|
-
/** 1 April 00:00:00.000 IST of `startYear`, as a UTC instant. */
|
|
17
|
-
export declare function financialYearStart(startYear: number): Date;
|
|
18
|
-
/** 31 March 23:59:59.999 IST of `startYear + 1`, as a UTC instant. */
|
|
19
|
-
export declare function financialYearEnd(startYear: number): Date;
|
|
20
|
-
/**
|
|
21
|
-
* The financial year's bounds as plain IST calendar dates, 'YYYY-MM-DD'.
|
|
22
|
-
*
|
|
23
|
-
* Preferred over the Date forms whenever the other side of the comparison also
|
|
24
|
-
* came out of Postgres as an IST calendar day, because string comparison of
|
|
25
|
-
* 'YYYY-MM-DD' cannot be knocked off by the process timezone. `timestamp
|
|
26
|
-
* without time zone` columns — which is what every contract date in this schema
|
|
27
|
-
* is — are parsed by node-postgres in the SERVER's local zone, so the same row
|
|
28
|
-
* yields a different instant on a UTC box than on an IST laptop.
|
|
29
|
-
*/
|
|
30
|
-
export declare function financialYearStartDay(startYear: number): string;
|
|
31
|
-
export declare function financialYearEndDay(startYear: number): string;
|
|
32
|
-
/**
|
|
33
|
-
* The financial year that contains `d`, identified by its opening calendar
|
|
34
|
-
* year: 2026 means FY 2026-27 (Apr 2026 – Mar 2027).
|
|
35
|
-
*
|
|
36
|
-
* Takes ANY instant inside the year rather than requiring the caller to pass
|
|
37
|
-
* 1 April, so a report can be re-run from a stored request payload without the
|
|
38
|
-
* caller having to remember which end of the range was canonical.
|
|
39
|
-
*/
|
|
40
|
-
export declare function resolveFinancialYearStartYear(d: Date | string): number;
|
|
41
|
-
/** e.g. startYear 2026 -> '2026-27'. */
|
|
42
|
-
export declare function financialYearLabel(startYear: number): string;
|
|
43
|
-
export interface FinancialYearMonth {
|
|
44
|
-
/** 0-based position in the financial year: 0 = April, 11 = March. */
|
|
45
|
-
index: number;
|
|
46
|
-
/** Calendar year of this month (2027 for the March of FY 2026-27). */
|
|
47
|
-
year: number;
|
|
48
|
-
/** 0-based calendar month, as `Date.getUTCMonth()` returns it. */
|
|
49
|
-
month: number;
|
|
50
|
-
/** 'Apr 26' — the label the RM/SD schedule column groups are titled with. */
|
|
51
|
-
label: string;
|
|
52
|
-
/**
|
|
53
|
-
* 'YYYY-MM'. Matches what `to_char(ts + interval '5 hours 30 minutes',
|
|
54
|
-
* 'YYYY-MM')` produces in Postgres, so a month can be bucketed in SQL and
|
|
55
|
-
* looked up here without either side parsing a timestamp in Node.
|
|
56
|
-
*/
|
|
57
|
-
key: string;
|
|
58
|
-
/** First instant of the month, 00:00:00.000 IST as a UTC instant. */
|
|
59
|
-
startUTC: Date;
|
|
60
|
-
/** Last instant of the month, 23:59:59.999 IST as a UTC instant. */
|
|
61
|
-
endUTC: Date;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* The twelve months of a financial year in order, April first.
|
|
65
|
-
*/
|
|
66
|
-
export declare function financialYearMonths(startYear: number): FinancialYearMonth[];
|
|
67
|
-
/**
|
|
68
|
-
* Which financial-year month `d` falls in, as a 0-based index (0 = April), or
|
|
69
|
-
* -1 when it falls outside the year entirely.
|
|
70
|
-
*
|
|
71
|
-
* Accepts either an instant (TimePeriod.startDate, a UTC timestamp) or a plain
|
|
72
|
-
* 'YYYY-MM-DD' calendar date (rvRefundDate, a Postgres `date`). A calendar date
|
|
73
|
-
* has no timezone at all, so it is read as the IST day it names — parsing it as
|
|
74
|
-
* a UTC instant and then adding the IST offset would move 1 April to 1 April
|
|
75
|
-
* 05:30 IST, which is still 1 April, but 31 March would move to 31 March 05:30
|
|
76
|
-
* and stay correct too. The branch exists so the intent is not accidental.
|
|
77
|
-
*/
|
|
78
|
-
export declare function financialYearMonthIndex(d: Date | string | null | undefined, startYear: number): number;
|
|
79
|
-
/**
|
|
80
|
-
* True when `d` lands strictly before 1 April 00:00 IST of the financial year —
|
|
81
|
-
* i.e. it belongs to the opening balance rather than to any month column.
|
|
82
|
-
*/
|
|
83
|
-
export declare function isBeforeFinancialYear(d: Date | string | null | undefined, startYear: number): boolean;
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { IST_OFFSET_MS, addIstOffset } from './ist';
|
|
2
|
-
/**
|
|
3
|
-
* Indian financial year helpers, in IST.
|
|
4
|
-
*
|
|
5
|
-
* A financial year runs 1 April 00:00:00.000 IST to 31 March 23:59:59.999 IST.
|
|
6
|
-
* Every boundary here is an IST boundary expressed as a UTC instant, because
|
|
7
|
-
* that is how the database stores time: TimePeriod.startDate for September 2026
|
|
8
|
-
* is 2026-08-31T18:30:00Z, i.e. 1 September 00:00 IST. Deriving the month with
|
|
9
|
-
* plain `getMonth()` on the server's local clock would put every payout period
|
|
10
|
-
* that starts at 18:30 UTC into the previous month on any machine running UTC —
|
|
11
|
-
* a whole column of the RM schedule shifted by one.
|
|
12
|
-
*
|
|
13
|
-
* Written for AD-3098 (BA Retention Money schedule) and deliberately kept free
|
|
14
|
-
* of anything RM-specific so AD-3097 (Security Deposit schedule), which has the
|
|
15
|
-
* same April–March, one-column-group-per-month shape, can use it unchanged.
|
|
16
|
-
*/
|
|
17
|
-
/** 1 April 00:00:00.000 IST of `startYear`, as a UTC instant. */
|
|
18
|
-
export function financialYearStart(startYear) {
|
|
19
|
-
return new Date(Date.UTC(startYear, 3, 1) - IST_OFFSET_MS);
|
|
20
|
-
}
|
|
21
|
-
/** 31 March 23:59:59.999 IST of `startYear + 1`, as a UTC instant. */
|
|
22
|
-
export function financialYearEnd(startYear) {
|
|
23
|
-
return new Date(Date.UTC(startYear + 1, 3, 1) - IST_OFFSET_MS - 1);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* The financial year's bounds as plain IST calendar dates, 'YYYY-MM-DD'.
|
|
27
|
-
*
|
|
28
|
-
* Preferred over the Date forms whenever the other side of the comparison also
|
|
29
|
-
* came out of Postgres as an IST calendar day, because string comparison of
|
|
30
|
-
* 'YYYY-MM-DD' cannot be knocked off by the process timezone. `timestamp
|
|
31
|
-
* without time zone` columns — which is what every contract date in this schema
|
|
32
|
-
* is — are parsed by node-postgres in the SERVER's local zone, so the same row
|
|
33
|
-
* yields a different instant on a UTC box than on an IST laptop.
|
|
34
|
-
*/
|
|
35
|
-
export function financialYearStartDay(startYear) {
|
|
36
|
-
return `${startYear}-04-01`;
|
|
37
|
-
}
|
|
38
|
-
export function financialYearEndDay(startYear) {
|
|
39
|
-
return `${startYear + 1}-03-31`;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* The financial year that contains `d`, identified by its opening calendar
|
|
43
|
-
* year: 2026 means FY 2026-27 (Apr 2026 – Mar 2027).
|
|
44
|
-
*
|
|
45
|
-
* Takes ANY instant inside the year rather than requiring the caller to pass
|
|
46
|
-
* 1 April, so a report can be re-run from a stored request payload without the
|
|
47
|
-
* caller having to remember which end of the range was canonical.
|
|
48
|
-
*/
|
|
49
|
-
export function resolveFinancialYearStartYear(d) {
|
|
50
|
-
const ist = addIstOffset(new Date(d));
|
|
51
|
-
const month = ist.getUTCMonth(); // 0 = January
|
|
52
|
-
const year = ist.getUTCFullYear();
|
|
53
|
-
// January, February and March belong to the FY that opened last April.
|
|
54
|
-
return month < 3 ? year - 1 : year;
|
|
55
|
-
}
|
|
56
|
-
/** e.g. startYear 2026 -> '2026-27'. */
|
|
57
|
-
export function financialYearLabel(startYear) {
|
|
58
|
-
return `${startYear}-${String((startYear + 1) % 100).padStart(2, '0')}`;
|
|
59
|
-
}
|
|
60
|
-
const MONTH_SHORT_NAMES = [
|
|
61
|
-
'Jan',
|
|
62
|
-
'Feb',
|
|
63
|
-
'Mar',
|
|
64
|
-
'Apr',
|
|
65
|
-
'May',
|
|
66
|
-
'Jun',
|
|
67
|
-
'Jul',
|
|
68
|
-
'Aug',
|
|
69
|
-
'Sep',
|
|
70
|
-
'Oct',
|
|
71
|
-
'Nov',
|
|
72
|
-
'Dec',
|
|
73
|
-
];
|
|
74
|
-
/**
|
|
75
|
-
* The twelve months of a financial year in order, April first.
|
|
76
|
-
*/
|
|
77
|
-
export function financialYearMonths(startYear) {
|
|
78
|
-
const months = [];
|
|
79
|
-
for (let index = 0; index < 12; index++) {
|
|
80
|
-
const absolute = 3 + index; // April is calendar month 3.
|
|
81
|
-
const year = startYear + Math.floor(absolute / 12);
|
|
82
|
-
const month = absolute % 12;
|
|
83
|
-
const startUTC = new Date(Date.UTC(year, month, 1) - IST_OFFSET_MS);
|
|
84
|
-
const endUTC = new Date(Date.UTC(year, month + 1, 1) - IST_OFFSET_MS - 1);
|
|
85
|
-
months.push({
|
|
86
|
-
index,
|
|
87
|
-
year,
|
|
88
|
-
month,
|
|
89
|
-
label: `${MONTH_SHORT_NAMES[month]} ${String(year % 100).padStart(2, '0')}`,
|
|
90
|
-
key: `${year}-${String(month + 1).padStart(2, '0')}`,
|
|
91
|
-
startUTC,
|
|
92
|
-
endUTC,
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
return months;
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Which financial-year month `d` falls in, as a 0-based index (0 = April), or
|
|
99
|
-
* -1 when it falls outside the year entirely.
|
|
100
|
-
*
|
|
101
|
-
* Accepts either an instant (TimePeriod.startDate, a UTC timestamp) or a plain
|
|
102
|
-
* 'YYYY-MM-DD' calendar date (rvRefundDate, a Postgres `date`). A calendar date
|
|
103
|
-
* has no timezone at all, so it is read as the IST day it names — parsing it as
|
|
104
|
-
* a UTC instant and then adding the IST offset would move 1 April to 1 April
|
|
105
|
-
* 05:30 IST, which is still 1 April, but 31 March would move to 31 March 05:30
|
|
106
|
-
* and stay correct too. The branch exists so the intent is not accidental.
|
|
107
|
-
*/
|
|
108
|
-
export function financialYearMonthIndex(d, startYear) {
|
|
109
|
-
if (d === null || d === undefined || d === '')
|
|
110
|
-
return -1;
|
|
111
|
-
let istYear;
|
|
112
|
-
let istMonth;
|
|
113
|
-
if (typeof d === 'string' && /^\d{4}-\d{2}(-\d{2})?$/.test(d)) {
|
|
114
|
-
istYear = Number(d.slice(0, 4));
|
|
115
|
-
istMonth = Number(d.slice(5, 7)) - 1;
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
const parsed = new Date(d);
|
|
119
|
-
if (Number.isNaN(parsed.getTime()))
|
|
120
|
-
return -1;
|
|
121
|
-
const ist = addIstOffset(parsed);
|
|
122
|
-
istYear = ist.getUTCFullYear();
|
|
123
|
-
istMonth = ist.getUTCMonth();
|
|
124
|
-
}
|
|
125
|
-
const absolute = (istYear - startYear) * 12 + istMonth - 3;
|
|
126
|
-
return absolute >= 0 && absolute < 12 ? absolute : -1;
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* True when `d` lands strictly before 1 April 00:00 IST of the financial year —
|
|
130
|
-
* i.e. it belongs to the opening balance rather than to any month column.
|
|
131
|
-
*/
|
|
132
|
-
export function isBeforeFinancialYear(d, startYear) {
|
|
133
|
-
if (d === null || d === undefined || d === '')
|
|
134
|
-
return false;
|
|
135
|
-
if (typeof d === 'string' && /^\d{4}-\d{2}(-\d{2})?$/.test(d)) {
|
|
136
|
-
const year = Number(d.slice(0, 4));
|
|
137
|
-
const month = Number(d.slice(5, 7)) - 1;
|
|
138
|
-
return year * 12 + month < startYear * 12 + 3;
|
|
139
|
-
}
|
|
140
|
-
const parsed = new Date(d);
|
|
141
|
-
if (Number.isNaN(parsed.getTime()))
|
|
142
|
-
return false;
|
|
143
|
-
return parsed.getTime() < financialYearStart(startYear).getTime();
|
|
144
|
-
}
|
|
145
|
-
//# sourceMappingURL=financial.year.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"financial.year.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/financial.year.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAEpD;;;;;;;;;;;;;;GAcG;AAEH,iEAAiE;AACjE,MAAM,UAAU,kBAAkB,CAAC,SAAiB;IACnD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;AAC5D,CAAC;AAED,sEAAsE;AACtE,MAAM,UAAU,gBAAgB,CAAC,SAAiB;IACjD,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,aAAa,GAAG,CAAC,CAAC,CAAC;AACpE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAiB;IACtD,OAAO,GAAG,SAAS,QAAQ,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACpD,OAAO,GAAG,SAAS,GAAG,CAAC,QAAQ,CAAC;AACjC,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,6BAA6B,CAAC,CAAgB;IAC7D,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC,cAAc;IAC/C,MAAM,IAAI,GAAG,GAAG,CAAC,cAAc,EAAE,CAAC;IAClC,uEAAuE;IACvE,OAAO,KAAK,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AAC,GAAG,EAAE,GAAG,QAAQ,GAAG,CAAC,CAAC;IAC3D,OAAO,QAAQ,IAAI,CAAC,IAAI,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACpC,CAAmC,EACnC,SAAiB;IAEjB,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,EAAE;QAAE,OAAO,KAAK,CAAC;IAE5D,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,wBAAwB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/D,MAAM,IAAI,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACnC,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QACxC,OAAO,IAAI,GAAG,EAAE,GAAG,KAAK,GAAG,SAAS,GAAG,EAAE,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3B,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QAAE,OAAO,KAAK,CAAC;IACjD,OAAO,MAAM,CAAC,OAAO,EAAE,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 1-based index of the IST calendar month `booking` falls in, counted from
|
|
3
|
-
* the IST calendar month of `anchor`. Same month → 1.
|
|
4
|
-
*
|
|
5
|
-
* The +5:30 shift moves the instant so that its UTC calendar fields read as
|
|
6
|
-
* IST wall-clock, so the components MUST be read with getUTC*. Reading the
|
|
7
|
-
* local ones (as this did originally) re-applies the host offset on top: on
|
|
8
|
-
* an IST-configured server that is +11:00, which lands on the next month for
|
|
9
|
-
* any booking picked up in the last 11 hours of a month and silently shifts
|
|
10
|
-
* that booking a whole cycle. Every sibling helper (isOnContractInMonth,
|
|
11
|
-
* monthIndexStartDate) already reads UTC fields — this is now consistent with
|
|
12
|
-
* them and independent of the host timezone.
|
|
13
|
-
*/
|
|
14
|
-
export declare function ltrCycleMonthIndex(anchor: Date, booking: Date): number;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { IST_OFFSET_MS } from './ist';
|
|
2
|
-
/**
|
|
3
|
-
* 1-based index of the IST calendar month `booking` falls in, counted from
|
|
4
|
-
* the IST calendar month of `anchor`. Same month → 1.
|
|
5
|
-
*
|
|
6
|
-
* The +5:30 shift moves the instant so that its UTC calendar fields read as
|
|
7
|
-
* IST wall-clock, so the components MUST be read with getUTC*. Reading the
|
|
8
|
-
* local ones (as this did originally) re-applies the host offset on top: on
|
|
9
|
-
* an IST-configured server that is +11:00, which lands on the next month for
|
|
10
|
-
* any booking picked up in the last 11 hours of a month and silently shifts
|
|
11
|
-
* that booking a whole cycle. Every sibling helper (isOnContractInMonth,
|
|
12
|
-
* monthIndexStartDate) already reads UTC fields — this is now consistent with
|
|
13
|
-
* them and independent of the host timezone.
|
|
14
|
-
*/
|
|
15
|
-
export function ltrCycleMonthIndex(anchor, booking) {
|
|
16
|
-
const anchorIst = new Date(anchor.getTime() + IST_OFFSET_MS);
|
|
17
|
-
const bookingIst = new Date(booking.getTime() + IST_OFFSET_MS);
|
|
18
|
-
return ((bookingIst.getUTCFullYear() - anchorIst.getUTCFullYear()) * 12 +
|
|
19
|
-
(bookingIst.getUTCMonth() - anchorIst.getUTCMonth()) +
|
|
20
|
-
1);
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=ltr.cycle.month.index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ltr.cycle.month.index.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/ltr.cycle.month.index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAY,EAAE,OAAa;IAC7D,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,CAAC;IAC7D,MAAM,UAAU,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,aAAa,CAAC,CAAC;IAC/D,OAAO,CACN,CAAC,UAAU,CAAC,cAAc,EAAE,GAAG,SAAS,CAAC,cAAc,EAAE,CAAC,GAAG,EAAE;QAC/D,CAAC,UAAU,CAAC,WAAW,EAAE,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;QACpD,CAAC,CACD,CAAC;AACH,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
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;
|
|
@@ -1,78 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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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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"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Normalises a raw phone value to E.164 (+91XXXXXXXXXX) format.
|
|
3
|
-
* Returns null for blank, non-numeric, or out-of-range inputs.
|
|
4
|
-
* Default country code is +91 (India).
|
|
5
|
-
*
|
|
6
|
-
* **Every number handed to the SMS gateway must come through here.** The
|
|
7
|
-
* gateway refuses anything that is not exactly 13 characters with `91` in
|
|
8
|
-
* positions 1-2 — a number stored as `+91-1234567890` is 14 characters, so it
|
|
9
|
-
* is rejected as an international send. That refusal is swallowed and recorded
|
|
10
|
-
* as a failed SMS log, so the caller is told the message went out and nothing
|
|
11
|
-
* arrives.
|
|
12
|
-
*
|
|
13
|
-
* Lives in the shared package rather than beside the alert handlers because the
|
|
14
|
-
* gatekeeper's OTP paths need it too, and a second copy over there is how the
|
|
15
|
-
* two would drift apart on which shapes they accept.
|
|
16
|
-
*/
|
|
17
|
-
export declare function normalizePhoneNumber(phone: string | number | null | undefined, countryCode?: string): string | null;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Normalises a raw phone value to E.164 (+91XXXXXXXXXX) format.
|
|
3
|
-
* Returns null for blank, non-numeric, or out-of-range inputs.
|
|
4
|
-
* Default country code is +91 (India).
|
|
5
|
-
*
|
|
6
|
-
* **Every number handed to the SMS gateway must come through here.** The
|
|
7
|
-
* gateway refuses anything that is not exactly 13 characters with `91` in
|
|
8
|
-
* positions 1-2 — a number stored as `+91-1234567890` is 14 characters, so it
|
|
9
|
-
* is rejected as an international send. That refusal is swallowed and recorded
|
|
10
|
-
* as a failed SMS log, so the caller is told the message went out and nothing
|
|
11
|
-
* arrives.
|
|
12
|
-
*
|
|
13
|
-
* Lives in the shared package rather than beside the alert handlers because the
|
|
14
|
-
* gatekeeper's OTP paths need it too, and a second copy over there is how the
|
|
15
|
-
* two would drift apart on which shapes they accept.
|
|
16
|
-
*/
|
|
17
|
-
export function normalizePhoneNumber(phone, countryCode = '+91') {
|
|
18
|
-
if (phone === null || phone === undefined) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
const raw = String(phone).trim();
|
|
22
|
-
if (!raw) {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
const ccDigits = countryCode.replace(/\D/g, '') || '91';
|
|
26
|
-
const digits = raw.replace(/\D/g, '');
|
|
27
|
-
if (!digits) {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
if (digits.length === 10) {
|
|
31
|
-
return `+${ccDigits}${digits}`;
|
|
32
|
-
}
|
|
33
|
-
if (digits.length === 12 && digits.startsWith(ccDigits)) {
|
|
34
|
-
return `+${digits}`;
|
|
35
|
-
}
|
|
36
|
-
const noLeadingZero = digits.replace(/^0+/, '');
|
|
37
|
-
if (noLeadingZero.length === 10) {
|
|
38
|
-
return `+${ccDigits}${noLeadingZero}`;
|
|
39
|
-
}
|
|
40
|
-
if (digits.length >= 10 && digits.length <= 15) {
|
|
41
|
-
return `+${digits}`;
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=normalize.phone.number.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize.phone.number.js","sourceRoot":"","sources":["../../../../../../../libs/shared/src/lib/utilities/src/normalize.phone.number.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,oBAAoB,CACnC,KAAyC,EACzC,cAAsB,KAAK;IAE3B,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IACb,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;IACjC,IAAI,CAAC,GAAG,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC;IACxD,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,EAAE,CAAC;QACb,OAAO,IAAI,CAAC;IACb,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QAC1B,OAAO,IAAI,QAAQ,GAAG,MAAM,EAAE,CAAC;IAChC,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,KAAK,EAAE,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzD,OAAO,IAAI,MAAM,EAAE,CAAC;IACrB,CAAC;IAED,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAChD,IAAI,aAAa,CAAC,MAAM,KAAK,EAAE,EAAE,CAAC;QACjC,OAAO,IAAI,QAAQ,GAAG,aAAa,EAAE,CAAC;IACvC,CAAC;IAED,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE,IAAI,MAAM,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC;QAChD,OAAO,IAAI,MAAM,EAAE,CAAC;IACrB,CAAC;IAED,OAAO,IAAI,CAAC;AACb,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
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;
|
|
@@ -1,43 +0,0 @@
|
|
|
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
|