@bisondesk/core-sdk 1.0.675 → 1.0.677
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/lib/apis/exchange-rates.d.ts +3 -0
- package/lib/apis/exchange-rates.d.ts.map +1 -1
- package/lib/apis/exchange-rates.js +29 -0
- package/lib/apis/exchange-rates.js.map +1 -1
- package/lib/constants.d.ts +1 -0
- package/lib/constants.d.ts.map +1 -1
- package/lib/constants.js +1 -0
- package/lib/constants.js.map +1 -1
- package/lib/types/intercompany-payments.d.ts.map +1 -1
- package/lib/types/intercompany-payments.js.map +1 -1
- package/lib/types/offers.d.ts +2 -1
- package/lib/types/offers.d.ts.map +1 -1
- package/lib/types/offers.js.map +1 -1
- package/lib/types/opportunities.d.ts +9 -0
- package/lib/types/opportunities.d.ts.map +1 -1
- package/lib/types/opportunities.js.map +1 -1
- package/lib/types/opportunity-payments.d.ts +9 -0
- package/lib/types/opportunity-payments.d.ts.map +1 -1
- package/lib/types/opportunity-payments.js.map +1 -1
- package/lib/types/quote-settings.d.ts +1 -0
- package/lib/types/quote-settings.d.ts.map +1 -1
- package/lib/types/quote-settings.js.map +1 -1
- package/lib/types/quotes.d.ts +1 -0
- package/lib/types/quotes.d.ts.map +1 -1
- package/lib/types/quotes.js.map +1 -1
- package/lib/types/tenants.d.ts +2 -0
- package/lib/types/tenants.d.ts.map +1 -1
- package/lib/types/tenants.js.map +1 -1
- package/lib/types/vehicle-purchase-payments.d.ts +8 -1
- package/lib/types/vehicle-purchase-payments.d.ts.map +1 -1
- package/lib/types/vehicle-purchase-payments.js.map +1 -1
- package/lib/types/vehicles.d.ts +7 -0
- package/lib/types/vehicles.d.ts.map +1 -1
- package/lib/types/vehicles.js.map +1 -1
- package/lib/utils/opportunity-payments.d.ts +3 -0
- package/lib/utils/opportunity-payments.d.ts.map +1 -0
- package/lib/utils/opportunity-payments.js +5 -0
- package/lib/utils/opportunity-payments.js.map +1 -0
- package/lib/utils/opportunity-payments.test.d.ts +2 -0
- package/lib/utils/opportunity-payments.test.d.ts.map +1 -0
- package/lib/utils/opportunity-payments.test.js +23 -0
- package/lib/utils/opportunity-payments.test.js.map +1 -0
- package/lib/utils/tenants.d.ts +4 -0
- package/lib/utils/tenants.d.ts.map +1 -1
- package/lib/utils/tenants.js +8 -0
- package/lib/utils/tenants.js.map +1 -1
- package/lib/utils/tenants.test.js +44 -1
- package/lib/utils/tenants.test.js.map +1 -1
- package/package.json +1 -1
- package/src/apis/exchange-rates.ts +49 -0
- package/src/constants.ts +2 -0
- package/src/types/intercompany-payments.ts +4 -3
- package/src/types/offers.ts +2 -0
- package/src/types/opportunities.ts +16 -0
- package/src/types/opportunity-payments.ts +23 -0
- package/src/types/quote-settings.ts +2 -0
- package/src/types/quotes.ts +2 -0
- package/src/types/tenants.ts +12 -0
- package/src/types/vehicle-purchase-payments.ts +16 -1
- package/src/types/vehicles.ts +15 -1
- package/src/utils/opportunity-payments.test.ts +31 -0
- package/src/utils/opportunity-payments.ts +15 -0
- package/src/utils/tenants.test.ts +60 -2
- package/src/utils/tenants.ts +28 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opportunities.js","sourceRoot":"/","sources":["types/opportunities.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAN,IAAY,kBAsBX;AAtBD,WAAY,kBAAkB;IAC5B,iDAA2B,CAAA;IAC3B,mDAA6B,CAAA;IAC7B,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,6DAAuC,CAAA;IACvC,+DAAyC,CAAA;IACzC,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,mDAA6B,CAAA;IAC7B,qDAA+B,CAAA;IAC/B,mDAA6B,CAAA;IAC7B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;IAC3B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;IAC3B,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,mEA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ClC,kBAAkB;CACsC,CAAC","sourcesContent":["import { Task } from '@bisondesk/commons-sdk/tasks';\nimport { Document, NextList } from '@bisondesk/commons-sdk/types';\nimport { BusinessEntityIds, OpportunityType, WarningHints } from '../constants.js';\nimport { Contact, Organization } from './crm.js';\nimport type { Interest, InterestBffMeta } from './interests.js';\nimport { BaseEvent } from './internal-events.js';\nimport { OpportunityPayment } from './opportunity-payments.js';\nimport { Quote, QuoteRecordMeta, QuoteStatus } from './quotes.js';\nimport { OpportunityReservation } from './reservations.js';\nimport { BaseSearchRequest, FieldId, PickFieldIds } from './search.js';\nimport { Transport } from './transports.js';\nimport { DataRecord, ReferenceData } from './utils.js';\nimport { Vehicle } from './vehicles.js';\n\nexport type ListOpportunitiesFilters = {\n offset?: number;\n limit?: number;\n organizationId?: string;\n contactId?: string;\n vehicleId?: string;\n vehicleIds?: string[];\n excludeOpportunityId?: string;\n excludeLost?: boolean;\n statuses?: OpportunityStatus[];\n since?: string;\n until?: string;\n};\n\nexport enum OpportunityActions {\n ADD_REMARKS = 'add_remarks',\n CREATE_QUOTE = 'create_quote',\n LOSE = 'lose',\n REOPEN = 'reopen',\n START_PREPARATION = 'start_preparation',\n REVERT_PREPARATION = 'revert_preparation',\n START_DELIVERY = 'start_delivery',\n REVERT_DELIVERY = 'revert_delivery',\n SET_CUSTOMER = 'set_customer',\n SET_DOCUMENTS = 'set_documents',\n SET_INTEREST = 'set_interest',\n SET_METADATA = 'set_metadata',\n SET_VEHICLE = 'set_vehicle',\n ADD_ACTIVITY = 'add_activity',\n ADD_PAYMENT = 'add_payment',\n SWITCH_VEHICLE = 'switch_vehicle',\n DELIVER_VEHICLE = 'deliver_vehicle',\n UNDO_DELIVER_VEHICLE = 'undo_deliver_vehicle',\n SET_DEAL_INFO = 'update_deal_info',\n ISSUE_INVOICE = 'issue_invoice',\n CREATE_MANUAL_SALES_INVOICE = 'create_manual_sales_invoice',\n}\n\nexport enum OpportunityPaymentStatus {\n PARTIAL_PAYMENT = 'partial_payment',\n FULL_PAYMENT = 'full_payment',\n NO_PAYMENT = 'no_payment',\n}\n\nexport enum OpportunityStatus {\n PROSPECTION = 'prospection',\n DISCOVERY = 'discovery',\n EVALUATION = 'evaluation',\n REVIEW = 'review',\n PREPARATION = 'preparation',\n DELIVERY = 'delivery',\n}\n\nexport const OpportunityStatusOrder: OpportunityStatus[] = [\n OpportunityStatus.PROSPECTION,\n OpportunityStatus.DISCOVERY,\n OpportunityStatus.EVALUATION,\n OpportunityStatus.REVIEW,\n OpportunityStatus.PREPARATION,\n OpportunityStatus.DELIVERY,\n];\n\nexport enum OpportunityRequirementsCode {\n VEHICLE_AT_ORIGIN = 'vehicle_at_origin',\n LEASING_SL_ACTION = 'sl_action',\n TECHNICAL_NOTES_CHANGED = 'technical_notes_changed',\n}\n\nexport enum OpportunityWarningsCode {\n QUOTE_PENDING_VALIDATION = 'quote_pending_validation',\n QUOTE_PEDING_MANAGER_APPROVAL = 'quote_pending_manager_approval',\n CONCURRENT_OPPORTUNITIES = 'concurrent_opportunities',\n VEHICLE_RESERVED = 'vehicle_reserved',\n OPPORTUNITY_NEEDS_SWITCH_VEHICLE = 'opportunity_needs_switch_vehicle',\n VEHICLE_RESERVED_DATE_INFO = 'vehicle_reserved_date_info',\n VEHICLE_RESERVED_INDEFINITELY = 'vehicle_reserved_indefinitely',\n QUOTE_MISSING_DELIVERY_DETAILS = 'quote_missing_delivery_details',\n VEHICLE_TECHNICAL_DETAILS_CHANGED = 'vehicle_technical_details_changed',\n QUOTE_MISSING_FINANCING_DETAILS = 'quote_missing_financing_details',\n VEHICLE_BRANCH_MISMATCH = 'vehicle_branch_mismatch',\n VEHICLE_UNAVAILABLE_AT_SOURCE = 'vehicle_unavailable_at_source',\n INTERCOMPANY_LINKED = 'intercompany_linked',\n INTERCOMPANY_SOURCE_OPPORTUNITY = 'intercompany_source_opportunity',\n INTERCOMPANY_SOURCE_UNRESERVED = 'intercompany_source_unreserved',\n}\n\nexport const OpportunityWonColumnId = 'closed_won';\n\nexport const OpportunityKanbanColumns = [...OpportunityStatusOrder, OpportunityWonColumnId];\n\nexport const OpportunityKanbanEndColumns: string[] = [OpportunityWonColumnId];\n\nexport enum OpportunityLostReasonValues {\n Expensive = 'expensive',\n AlreadySold = 'already_sold',\n BadExperience = 'bad_experience',\n IncorrectVehicleCondition = 'incorrect_vehicle_condition',\n NoStock = 'not_enough_stock',\n SlowDelivery = 'slow_delivery',\n HighDeposit = 'deposit_too_high',\n NoAnswer = 'client_not_answered',\n Automatic = 'automatic',\n LeasingDeal = 'sold-via-leasing',\n InvestmentPostponed = 'investment_postponed',\n /** The target-tenant deal released the vehicle (lost, or its reservation expired). */\n IntercompanyReleased = 'intercompany_released',\n}\n\ntype BaseBid = {\n vehicleId: string;\n opportunityId?: string;\n contactId: string;\n amount: string;\n};\n\nexport type NewBid = BaseBid & {};\n\nexport type Bid = BaseBid & {\n id: string;\n createdAt: string;\n createdBy: string;\n};\n\n/**\n * Provenance of a customer deal whose vehicle is fulfilled by a source-tenant intercompany\n * opportunity. Written only by the intercompany coordination\n * (cross-tenant-sync/ico-opportunities);\n * the link table at the source is its mirror. Powers deep links, the payments walk and\n * support digging — never availability decisions.\n */\nexport type OpportunityIntercompanyInfo = {\n sourceTenantId: string;\n sourceBranchId: string;\n sourceOpportunityId: string;\n sourceReservationId: string;\n};\n\ntype BaseOpportunity = {\n accountManager?: string;\n administrativePerson?: string;\n type: OpportunityType;\n organizationId?: string;\n contactId?: string;\n vehicleId?: string;\n source?: string; // e.g. website, autoscout, mobile...\n branch: string;\n inquiry?: string;\n branchCountry: string;\n intercompany?: OpportunityIntercompanyInfo;\n};\n\n// type, branch and branchCountry are optional: when omitted, the server defaults them\n// from the requester's preferred branches/opportunity types, then the tenant defaults.\nexport type NewOpportunity = Omit<BaseOpportunity, 'type' | 'branch' | 'branchCountry'> &\n Partial<Pick<BaseOpportunity, 'type' | 'branch' | 'branchCountry'>> & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n };\n\nexport enum VehicleSaleDealStatus {\n SaleAgreed = 'SALE_AGREED',\n FirstPaymentReceived = 'FIRST_PAYMENT_RECEIVED',\n FullPaymentReceived = 'FULL_PAYMENT_RECEIVED',\n}\n\nexport enum VehicleSaleLogisticsStatus {\n AtOrigin = 'AT_ORIGIN',\n Delivered = 'DELIVERED',\n}\n\nexport type Opportunity = BaseOpportunity & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n engagedAt?: string;\n engagedBy?: string;\n validatedAt?: string;\n validatedBy?: string;\n acceptedAt?: string;\n acceptedBy?: string;\n firstAcceptedAt?: string;\n lastActivityAt?: string; // last time we reached out to the customer, regardless of medium\n reviewedAt?: string;\n reviewedBy?: string;\n preparedAt?: string;\n preparedBy?: string;\n lastBidAt?: string;\n lostAt?: string;\n lostBy?: string;\n wonAt?: string;\n lostReason?: OpportunityLostReasonValues;\n deliveredAt?: string;\n deliveredBy?: string;\n deliveredMode?: 'CMR' | 'Action' | 'DeliveryConfirmation';\n saleDeliveryTransportEligibleAt?: string;\n status: OpportunityStatus;\n dealStatus?: VehicleSaleDealStatus;\n logisticStatus?: VehicleSaleLogisticsStatus;\n activeQuoteId?: string;\n amount?: string;\n documents?: Document[];\n leasingContractId?: string;\n internalLeasingContractId?: string;\n accountManagerAssistant?: string;\n requirementsOverride?: {\n [code: string]: { override: true; reason?: string; actionAt: string; actionBy: string };\n };\n};\n\nexport type OpportunityUpdate = {\n vehicleId?: string | null;\n accountManager?: string | null;\n accountManagerAssistant?: string | null;\n administrativePerson?: string | null;\n contactId?: string | null;\n activeQuoteId?: string | null;\n reviewed?: boolean;\n prepared?: boolean;\n lost?: boolean;\n delivered?: boolean;\n lostReason?: OpportunityLostReasonValues;\n documents?: Document[];\n branch?: string;\n branchCountry?: string;\n type?: OpportunityType;\n lastActivityAt?: string | null; // null gives the possibility to delete this field if all activities are deleted\n lastBidAt?: string;\n source?: string | null;\n requirementsOverride?: {\n [code: string]: { override: true; reason?: string; actionAt: string; actionBy: string };\n };\n};\n\nexport type OpportunityPaymentSummary = {\n total: string;\n paid: string;\n entries: DataRecord<OpportunityPayment>[];\n};\n\n/** @deprecated Renamed to {@link OpportunityPaymentSummary}. */\nexport type PaymentSummary = OpportunityPaymentSummary;\n\nexport type VehicleBffMetadata = {\n openOpportunities: number;\n otherRelatedVehicleIds: string[];\n};\n\nexport type OpportunityStatusRequirement = { code: OpportunityRequirementsCode; title?: string };\n\ntype OportunityWarningActionLink = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n /**\n * Absolute URL, set only when the record lives at another tenant — in-app routing cannot\n * reach it, so the client opens it in a new tab. Same shape the intercompany payments walk\n * already hands the client (ADR-0024's `opportunityUrl`).\n */\n url?: string;\n};\n\ntype OportunityWarningActionData = { [key: string]: string | number };\n\nexport type OpportunityWarning = {\n code: OpportunityWarningsCode;\n level: WarningHints;\n link?: OportunityWarningActionLink;\n data?: OportunityWarningActionData;\n showAction?: boolean;\n};\n\nexport enum OpportunityActionBlockerCode {\n MISSING_CUSTOMER = 'missing_customer',\n VEHICLE_BRANCH_MISMATCH = 'vehicle_branch_mismatch',\n MINIMUM_PAYMENT_MISSING = 'minimum_payment_missing',\n MISSING_FINANCING = 'missing_financing',\n BLOCKING_TASKS = 'blocking_tasks',\n}\n\nexport type OpportunityActionBlocker = {\n code: OpportunityActionBlockerCode;\n data?: OportunityWarningActionData;\n};\n\n/**\n * Why an action the user would otherwise expect to see is refused right now. Only actions whose\n * remaining conditions the user can act on are listed: a wrong status or a missing role hides the\n * action instead, as before.\n */\nexport type OpportunityBlockedAction = {\n action: OpportunityActions;\n reasons: OpportunityActionBlocker[];\n};\n\nexport type OpportunityBffMeta = ReferenceData & {\n requirements: OpportunityStatusRequirement[];\n warnings: OpportunityWarning[];\n blockedActions: OpportunityBlockedAction[];\n};\n\nexport type ContactMetdata = {\n openOpportunities: number;\n};\n\nexport type OpportunityBFF = {\n opportunity: DataRecord<Opportunity, OpportunityBffMeta>;\n vehicle?: DataRecord<Vehicle, VehicleBffMetadata>;\n interest?: DataRecord<Interest, InterestBffMeta>;\n bids: DataRecord<Bid>[];\n /** Every quote the deal has ever had; the ones it has left carry `meta.archived`. */\n quotes: DataRecord<Quote, QuoteRecordMeta>[];\n activeQuote?: DataRecord<Quote, QuoteRecordMeta>;\n payments: OpportunityPaymentSummary | undefined;\n reservation?: DataRecord<OpportunityReservation>;\n tasks: DataRecord<Task>[];\n customer?: {\n contact: DataRecord<Contact, ContactMetdata>;\n org?: DataRecord<Organization>;\n };\n transport?: Transport;\n};\n\ntype BaseOpportunityEvent = BaseEvent & {\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type OpportunityCreateEvent = BaseOpportunityEvent & {\n opportunity: Opportunity;\n previousOpportunity?: undefined;\n action: 'create';\n};\n\nexport type OpportunityUpdateEvent = BaseOpportunityEvent & {\n opportunity: Opportunity;\n previousOpportunity: Opportunity;\n action: 'update';\n};\n\nexport type OpportunityEvent = OpportunityCreateEvent | OpportunityUpdateEvent;\n\nexport type QuoteEvent = {\n quote: Quote;\n opportunity: Opportunity;\n action: 'create' | 'update';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\n/* Quote summary with information that should be common to different types of quotes */\nexport type QuoteInfo = {\n status: QuoteStatus;\n roi: string;\n id: string;\n // Leasing-only metrics, denormalized from the active leasing quote so the leasing report\n // can take medians without re-reading each quote. Absent on non-leasing quotes.\n /** Leasing term in months (`calculatorInput.leasing.duration`). */\n durationMonths?: number;\n /** Yearly ROI as a percentage 0–100 (`calculatorOutput.roi.perYear`). */\n roiPerYear?: number;\n /** Advance (deposit) as a percentage 0–100 (`calculatorInput.leasing.depositPercentage`). */\n advancePercentage?: number;\n};\n\nexport type SearchOpportunity = {\n contact?: Contact;\n opportunity: Opportunity;\n org?: Organization;\n vehicle?: Vehicle;\n transport?: Transport;\n quote?: QuoteInfo;\n custom: {\n groupKey: string;\n web2Lead: boolean;\n payment: { status: OpportunityPaymentStatus; percentagePaid: string };\n unassigned: boolean;\n lost: boolean;\n assignees: string[];\n accountManagers: string[];\n vehicleCheckedIn: boolean;\n status: OpportunityStatus | 'won';\n // Denormalized at indexing time from VehiclePurchase.log.checkedInAt so the opp index\n // can answer \"how long has this vehicle been visible on the website\" without joining.\n checkedInAt?: string;\n // Calendar days from min(marketingAt, evaluationAt, purchaseAgreedAt) until validatedAt.\n // Mirrors `daysInVirtualInventory` on the vehicle Business Overview page.\n daysAvailable?: number;\n // Operational supplier for reporting. For SLB clones this is the source vehicle supplier,\n // not the bank supplier on the clone purchase.\n realSupplierId?: string;\n // Branch of the associated vehicle, coalesced from the synced original branch then the\n // local branch — mirrors the vehicle index `custom.originalBranchId` facet.\n originalBranchId?: string;\n };\n};\n\nexport const QUOTE_NEEDS_VALIDATION_NOTIFICATION_ORIGIN = 'quote-validation';\nexport const QUOTE_NOT_CREATED_BY_ACCOUNT_MANAGER = 'quote-not-created-by-account-manager';\nexport const QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-validation-feedback';\n\nexport const OPPORTUNITY_ASSIGNED_NOTIFICATION_ORIGIN = 'opportunity-assigned';\nexport const OPPORTUNITY_VEHICLE_AVAILABLE_NOTIFICATION_ORIGIN = 'opportunity-vehicle-available';\nexport const OPPORTUNITY_VEHICLE_DELIVERY_NOTIFICATION_ORIGIN = 'opportunity-vehicle-delivery';\nexport const OPPORTUNITY_VEHICLE_RESERVATION_ABOUT_TO_EXPIRE_NOTIFICATION_ORIGIN =\n 'opportunity-vehicle-reservation-to-expire';\nexport const OPPORTUNITY_VEHICLE_RESERVATION_EXPIRED_NOTIFICATION_ORIGIN =\n 'opportunity-vehicle-reservation-expired';\nexport const INTERCOMPANY_OPPORTUNITY_RELEASED_NOTIFICATION_ORIGIN =\n 'intercompany-opportunity-released';\n\nexport const OFFER_SET_FINAL_VALUATION_ORIGIN = 'offer-set-final-valuation';\n\nexport const VEHICLE_PRICE_DECREASES_NOTIFICATION_ORIGIN = 'vehicle-price-decreased';\nexport const VEHICLE_ARRIVED_NOTIFICATION_ORIGIN = 'vehicle-arrived';\nexport const VEHICLE_CHECKEDIN_NOTIFICATION_ORIGIN = 'vehicle-checkedin';\nexport const VEHICLE_FULLY_PAID_NOTIFICATION_ORIGIN = 'vehicle-fully-paid';\nexport const VEHICLE_PURCHASED_NOTIFICATION_ORIGIN = 'vehicle-purchased';\nexport const VEHICLE_PRICE_CHANGED_NOTIFICATION_ORIGIN = 'vehicle-price-changed';\nexport const VEHICLE_SOLD_NOTIFICATION_ORIGIN = 'vehicle-sold';\n\nexport type OpportunityNotificationData = {\n quoteVersion?: number;\n snippet?: string;\n};\n\n/**\n * The fields of an opportunity that the kanban board's cards show. The kanban search returns\n * only these, so a card reading a field outside this list gets nothing.\n */\nexport const KANBAN_OPPORTUNITY_ITEM_FIELDS = [\n 'opportunity.id',\n 'opportunity.status',\n 'opportunity.amount',\n 'opportunity.accountManager',\n 'opportunity.accountManagerAssistant',\n 'opportunity.administrativePerson',\n 'opportunity.createdAt',\n 'opportunity.acceptedAt',\n 'opportunity.reviewedAt',\n 'opportunity.deliveredAt',\n 'opportunity.lastActivityAt',\n 'opportunity.lostAt',\n 'custom.web2Lead',\n 'custom.payment.percentagePaid',\n 'org.id',\n 'org.name',\n 'org.countryCode',\n 'contact.id',\n 'contact.firstName',\n 'contact.lastName',\n 'contact.countryCode',\n 'vehicle.id',\n 'vehicle.internal.identification.stockNumber',\n 'vehicle.internal.identification.administrativeNumber',\n 'vehicle.internal.description.title',\n 'vehicle.external.mainPicture.url',\n 'transport.status',\n] as const satisfies readonly FieldId<SearchOpportunity>[];\n\n/** An opportunity on the kanban board: its search document cut down to the card's fields. */\nexport type KanbanOpportunityItem = PickFieldIds<\n SearchOpportunity,\n (typeof KANBAN_OPPORTUNITY_ITEM_FIELDS)[number]\n>;\n\nexport type KanbanOpportunityGroup = {\n items: KanbanOpportunityItem[];\n};\n\nexport type OpportunitiesKanbanColumn = {\n status: string;\n results: KanbanOpportunityItem[];\n groups?: KanbanOpportunityGroup[];\n totalCount: number;\n totalValue: string;\n};\n\nexport type MSearchOpportunitiesKanbanColumn = {\n column: OpportunitiesKanbanColumn;\n nextToken?: string;\n};\n\ntype HpLeasingDealRunDataBase = {\n bisondeskTenantId: string;\n entityOwner: string;\n opportunityId: string;\n};\n\n// Field ids match the hpaci (Mr Lease CI) leasing-deal process definition: the LD is the only\n// Hyperportal process for that tenant (no C flow) and the contract document lives in BisonDesk.\nexport type HpLeasingDealRunDataCi = HpLeasingDealRunDataBase & {\n client?: string;\n vendeur?: string;\n vehicule?: string;\n plaqueDimmatriculation?: string;\n numeroDeContratLeasing: string;\n dateDeDebutDuContrat?: number;\n prixDeVenteHorsTvaXof: string;\n montantDavanceTtcXof: string;\n depotDeGarantieXof?: string;\n dueeDuLeasingEnMois: number;\n travauxHorsNormesNecessaire: boolean;\n descriptionDesTravauxHorsNormes: string;\n};\n\nexport type HpLeasingDealRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: HpLeasingDealRunDataDefault | HpLeasingDealRunDataCi;\n};\n\nexport type HpLeasingDealRunDataDefault = HpLeasingDealRunDataBase & {\n leasingContractOwner?: string;\n foreseenDeliveryDate?: string;\n deliveryAddressLeasing?: string;\n nameSalesPerson: string;\n durationLeasingInMonths: number;\n vanCourier: boolean;\n newVehicle?: boolean;\n newTrailer?: boolean;\n registrationOnTtcoBe?: boolean;\n externalDelivery?: boolean;\n civilLiabilities?: boolean;\n specialTechnicalInsurance?: boolean;\n allRisks?: boolean;\n roadAssistance?: boolean;\n vabAssistanceVan?: boolean;\n yearOfConstruction?: number;\n chassisnumber?: string;\n vehicleModel?: string;\n vehicleCategory2?: string;\n licencePlate?: string;\n vatPercentage?: number;\n\n opportunityContractId: string;\n\n company?: string;\n customerNumber?: number; //bisondesk external id\n slbPartner?: string;\n //MrLease fields\n vehicle?: string;\n vehicleNewReferenceMl?: string;\n referencePurchaserTtcoKleyn?: string;\n salesPriceEur: string;\n depositFullAmountExclVat: string;\n depositToBePrepaidExclVat: string;\n vehicleMake3?: string;\n\n //TTC fields\n vehicleOriginalReference?: string;\n salesPrice: string;\n depositFullAmount: string;\n depositAmountToBePrepaid: string;\n make?: string;\n\n //Extras\n garageExtrasCodes: string[];\n allExtrasDescriptions: string[];\n administrationExtrasCodes: string[];\n logisticExtrasCodes: string[];\n customRequestDescriptions: string[];\n};\n\nexport type HpLeasingDealResponse = {\n entityId: string;\n id: string;\n status: string;\n leasingContractNumber?: string;\n};\n\nexport type HpLeasingContractRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n bisondeskTenantId: string;\n entityOwner: string;\n leasingContractOwner?: string;\n totalLeasingAmount: string;\n company?: string;\n vehicle?: string;\n ldNumber: number;\n vanCourier: boolean;\n startDate: number;\n opportunityContractId: string;\n data: {\n leasingParameter: {\n allRisksPercentage: number;\n allRisksTaxPercentage: number;\n civilLiability: number;\n entityId: string;\n oneTimeRoadTax: number;\n specialInsurance: number;\n yearlyRoadTax: number;\n countries: string[];\n vehicleCategory: string;\n };\n\n calculatorRequest: {\n bankDeposit: number;\n bankDurationInMonths: number;\n bankInterestRatePercentage: number;\n bankResidualValue: number;\n deposit: number;\n durationInMonths: number;\n includesAllRisks: boolean;\n includesCivilLiability: boolean;\n includesOneTimeRoadTax: boolean;\n includesSpecialInsurance: boolean;\n includesYearlyRoadTax: boolean;\n insuranceAmount: number;\n interestRatePercentage: number;\n marginPercentage: number;\n monthlyAdministrationFee: 0;\n purchasePrice: number;\n residualValue: number;\n salesPrice: number;\n startupFeePercentage: number;\n };\n\n calculatorResponse: {\n ROI: number;\n ROIDifference: number;\n ROIPerYear: number;\n ROITarget: number;\n allRisksInsuranceAmount: number;\n bankContractValue: number;\n bankLeasingAmount: number;\n cashDeficit: number;\n financingAmount: number;\n leasingAmount: number;\n leasingContractValue: number;\n leasingProfit: number;\n monthlyTaxRetailPrice: number;\n oneTimeTaxCost: number;\n totalMonthlyPayment: number;\n totalProfit: number;\n vehicleProfit: number;\n };\n\n cashInValues: CashInRow[];\n\n cashOutValues: CashOutRow[];\n };\n };\n};\n\nexport type HpLeasingContractResponse = {\n entityId: string;\n id: string;\n status: string;\n createdAt: string;\n updatedAt: string;\n dateOfFinalSettlement: string;\n startDate: string;\n email: string;\n contractNumber: string;\n};\n\nexport type HpLeasingDealReturnRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n bisondeskTenantId: string;\n entityOwner: string;\n leasingContractNumber2: string;\n leasingContractNumber: string;\n opportunityContractId: string;\n company: string;\n vehicle: string;\n };\n};\n\nexport type HpLeasingDealEndRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n bisondeskTenantId: string;\n entityOwner: string;\n leasingContractOwner: string;\n vehicleOldReference: string;\n leasingContractNumber: string;\n company: string;\n vehicleNewReference: string;\n };\n};\n\nexport type CashInRow = {\n time: number;\n deposit: number;\n monthlyAdministrationFee: 0; //Legacy field - Should always be 0\n residualValue: number;\n startupFee: number;\n leasingAmountWithoutAdminFee: number;\n insurancePayment: number;\n taxPayment: number;\n cashIn: number;\n cumulativeCash: number;\n};\n\nexport type CashOutRow = {\n time: number;\n deposit: number;\n residualValue: number;\n leasingAmount: number;\n insurancePayment: number;\n taxPayment: number;\n cashOut: number;\n cumulativeCash: number;\n};\n\nexport type HpDeliveryFields = {\n detailsOfStacking?: string | null;\n technicalControlNeeded: boolean | null;\n\n //PickUP Delivery\n urgentDelivery?: boolean | null;\n dateOfPickUpByCustomer?: number | null;\n modeOfTransportPickUpByCustomer?: string | null; //entity Id\n detailsOfBorderCrossing?: string | null;\n insuranceNeeded: boolean | null;\n transitPlateNeeded: boolean | null;\n licensePlateNeeded: boolean | null;\n\n //Address Delivery\n address?: string | null;\n kmToAddressOfDelivery?: number | null;\n\n //To Port Delivery\n originPortText?: string | null; //entity Id\n shippingCompany?: string | null; //string Id\n destinationPort?: string | null;\n cleaningDegassingNeeded: boolean | null;\n};\n\nexport type HpIsaProcessRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: HpDeliveryFields & {\n entityOwner: string;\n nameSalesPerson: string;\n\n company?: string; //entityId\n proofOfSaleCustomerAgreement?: string; //entityId\n\n vehicle?: string; //entityId\n bodywork?: string; //entityId\n vehicleCategory: string; //entityId\n\n amountOfCommissionPaid: number;\n opportunityId: string;\n deliveryType: string; //entity Id\n directDelivery?: boolean | null;\n directDeliveryReason?: string | null;\n agreedPrice?: string;\n\n //Extras\n garageExtrasCodes: string[];\n logisticsExtrasCodes: string[];\n administrationExtrasCodes: string[];\n allExtrasDescriptions: string[];\n customRequestDescriptions: string[];\n infoSpoiler: string; // entity Id\n };\n};\n\nexport type HpIsaProcessResponse = {\n entityId: string;\n id: string;\n status: string;\n};\n\nexport type HpWorkOrderProcessRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n\n opportunityId: string;\n\n //Extras\n garageExtrasCodes: string[];\n allExtrasDescriptions: string[];\n\n customerRequestDescriptions: string[];\n directDeliveryReason?: string | null;\n salesPerson: string; // entityId\n customerName: string;\n referenceNumber: string;\n make?: string; //entityId\n typeTrailer?: string; //entityId\n\n vinNumber?: string;\n foreseenArrivalDateTrailer?: string;\n deadlineRequest?: number;\n locationVehicle2?: string; //entityId\n customer: string; //entityId\n vehicle: string; //entityId\n trailerHasBeenCheckedIn: boolean;\n deliveryDetails?: string | null;\n technicalInspectionNeeded: boolean | null;\n adr: boolean | null;\n };\n};\n\nexport type HpWorkOrderProcessResponse = {\n entityId: string;\n id: string;\n status: string;\n};\n\nexport type SwitchOpportunityVehicleRequest = {\n opportunity: Opportunity;\n newVehicleId: string;\n};\n\nexport type KanbanOpportunitiesSearchRequest = BaseSearchRequest & {\n nextTokens?: Record<string, string | undefined>;\n groupByClient?: boolean;\n};\n\nexport type KanbanOpportunitiesNextList = Omit<\n NextList<OpportunitiesKanbanColumn, ReferenceData>,\n 'nextToken'\n> & {\n nextTokens?: Record<string, string | undefined>;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"opportunities.js","sourceRoot":"/","sources":["types/opportunities.ts"],"names":[],"mappings":"AA4BA,MAAM,CAAN,IAAY,kBAsBX;AAtBD,WAAY,kBAAkB;IAC5B,iDAA2B,CAAA;IAC3B,mDAA6B,CAAA;IAC7B,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,6DAAuC,CAAA;IACvC,+DAAyC,CAAA;IACzC,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,mDAA6B,CAAA;IAC7B,qDAA+B,CAAA;IAC/B,mDAA6B,CAAA;IAC7B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;IAC3B,mDAA6B,CAAA;IAC7B,iDAA2B,CAAA;IAC3B,uDAAiC,CAAA;IACjC,yDAAmC,CAAA;IACnC,mEAA6C,CAAA;IAC7C,wDAAkC,CAAA;IAClC,qDAA+B,CAAA;IAC/B,iFAA2D,CAAA;AAC7D,CAAC,EAtBW,kBAAkB,KAAlB,kBAAkB,QAsB7B;AAED,MAAM,CAAN,IAAY,wBAIX;AAJD,WAAY,wBAAwB;IAClC,+DAAmC,CAAA;IACnC,yDAA6B,CAAA;IAC7B,qDAAyB,CAAA;AAC3B,CAAC,EAJW,wBAAwB,KAAxB,wBAAwB,QAInC;AAED,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,gDAA2B,CAAA;IAC3B,4CAAuB,CAAA;IACvB,8CAAyB,CAAA;IACzB,sCAAiB,CAAA;IACjB,gDAA2B,CAAA;IAC3B,0CAAqB,CAAA;AACvB,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAwB;IACzD,iBAAiB,CAAC,WAAW;IAC7B,iBAAiB,CAAC,SAAS;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AACzE,MAAM,CAAC,MAAM,sCAAsC,GAAG,oBAAoB,CAAC;AAC3E,MAAM,CAAC,MAAM,qCAAqC,GAAG,mBAAmB,CAAC;AACzE,MAAM,CAAC,MAAM,yCAAyC,GAAG,uBAAuB,CAAC;AACjF,MAAM,CAAC,MAAM,gCAAgC,GAAG,cAAc,CAAC;AAW/D,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C,gBAAgB;IAChB,oBAAoB;IACpB,oBAAoB;IACpB,4BAA4B;IAC5B,qCAAqC;IACrC,kCAAkC;IAClC,uBAAuB;IACvB,wBAAwB;IACxB,wBAAwB;IACxB,yBAAyB;IACzB,4BAA4B;IAC5B,oBAAoB;IACpB,iBAAiB;IACjB,+BAA+B;IAC/B,QAAQ;IACR,UAAU;IACV,iBAAiB;IACjB,YAAY;IACZ,mBAAmB;IACnB,kBAAkB;IAClB,qBAAqB;IACrB,YAAY;IACZ,6CAA6C;IAC7C,sDAAsD;IACtD,oCAAoC;IACpC,kCAAkC;IAClC,kBAAkB;CACsC,CAAC","sourcesContent":["import { Task } from '@bisondesk/commons-sdk/tasks';\nimport { Document, NextList } from '@bisondesk/commons-sdk/types';\nimport { BusinessEntityIds, OpportunityType, WarningHints } from '../constants.js';\nimport { Contact, Organization } from './crm.js';\nimport type { Interest, InterestBffMeta } from './interests.js';\nimport { BaseEvent } from './internal-events.js';\nimport { OpportunityPayment } from './opportunity-payments.js';\nimport { Quote, QuoteRecordMeta, QuoteStatus } from './quotes.js';\nimport { OpportunityReservation } from './reservations.js';\nimport { BaseSearchRequest, FieldId, PickFieldIds } from './search.js';\nimport { Transport } from './transports.js';\nimport { DataRecord, ReferenceData } from './utils.js';\nimport { Vehicle } from './vehicles.js';\n\nexport type ListOpportunitiesFilters = {\n offset?: number;\n limit?: number;\n organizationId?: string;\n contactId?: string;\n vehicleId?: string;\n vehicleIds?: string[];\n excludeOpportunityId?: string;\n excludeLost?: boolean;\n statuses?: OpportunityStatus[];\n since?: string;\n until?: string;\n};\n\nexport enum OpportunityActions {\n ADD_REMARKS = 'add_remarks',\n CREATE_QUOTE = 'create_quote',\n LOSE = 'lose',\n REOPEN = 'reopen',\n START_PREPARATION = 'start_preparation',\n REVERT_PREPARATION = 'revert_preparation',\n START_DELIVERY = 'start_delivery',\n REVERT_DELIVERY = 'revert_delivery',\n SET_CUSTOMER = 'set_customer',\n SET_DOCUMENTS = 'set_documents',\n SET_INTEREST = 'set_interest',\n SET_METADATA = 'set_metadata',\n SET_VEHICLE = 'set_vehicle',\n ADD_ACTIVITY = 'add_activity',\n ADD_PAYMENT = 'add_payment',\n SWITCH_VEHICLE = 'switch_vehicle',\n DELIVER_VEHICLE = 'deliver_vehicle',\n UNDO_DELIVER_VEHICLE = 'undo_deliver_vehicle',\n SET_DEAL_INFO = 'update_deal_info',\n ISSUE_INVOICE = 'issue_invoice',\n CREATE_MANUAL_SALES_INVOICE = 'create_manual_sales_invoice',\n}\n\nexport enum OpportunityPaymentStatus {\n PARTIAL_PAYMENT = 'partial_payment',\n FULL_PAYMENT = 'full_payment',\n NO_PAYMENT = 'no_payment',\n}\n\nexport enum OpportunityStatus {\n PROSPECTION = 'prospection',\n DISCOVERY = 'discovery',\n EVALUATION = 'evaluation',\n REVIEW = 'review',\n PREPARATION = 'preparation',\n DELIVERY = 'delivery',\n}\n\nexport const OpportunityStatusOrder: OpportunityStatus[] = [\n OpportunityStatus.PROSPECTION,\n OpportunityStatus.DISCOVERY,\n OpportunityStatus.EVALUATION,\n OpportunityStatus.REVIEW,\n OpportunityStatus.PREPARATION,\n OpportunityStatus.DELIVERY,\n];\n\nexport enum OpportunityRequirementsCode {\n VEHICLE_AT_ORIGIN = 'vehicle_at_origin',\n LEASING_SL_ACTION = 'sl_action',\n TECHNICAL_NOTES_CHANGED = 'technical_notes_changed',\n}\n\nexport enum OpportunityWarningsCode {\n QUOTE_PENDING_VALIDATION = 'quote_pending_validation',\n QUOTE_PEDING_MANAGER_APPROVAL = 'quote_pending_manager_approval',\n CONCURRENT_OPPORTUNITIES = 'concurrent_opportunities',\n VEHICLE_RESERVED = 'vehicle_reserved',\n OPPORTUNITY_NEEDS_SWITCH_VEHICLE = 'opportunity_needs_switch_vehicle',\n VEHICLE_RESERVED_DATE_INFO = 'vehicle_reserved_date_info',\n VEHICLE_RESERVED_INDEFINITELY = 'vehicle_reserved_indefinitely',\n QUOTE_MISSING_DELIVERY_DETAILS = 'quote_missing_delivery_details',\n VEHICLE_TECHNICAL_DETAILS_CHANGED = 'vehicle_technical_details_changed',\n QUOTE_MISSING_FINANCING_DETAILS = 'quote_missing_financing_details',\n VEHICLE_BRANCH_MISMATCH = 'vehicle_branch_mismatch',\n VEHICLE_UNAVAILABLE_AT_SOURCE = 'vehicle_unavailable_at_source',\n INTERCOMPANY_LINKED = 'intercompany_linked',\n INTERCOMPANY_SOURCE_OPPORTUNITY = 'intercompany_source_opportunity',\n INTERCOMPANY_SOURCE_UNRESERVED = 'intercompany_source_unreserved',\n}\n\nexport const OpportunityWonColumnId = 'closed_won';\n\nexport const OpportunityKanbanColumns = [...OpportunityStatusOrder, OpportunityWonColumnId];\n\nexport const OpportunityKanbanEndColumns: string[] = [OpportunityWonColumnId];\n\nexport enum OpportunityLostReasonValues {\n Expensive = 'expensive',\n AlreadySold = 'already_sold',\n BadExperience = 'bad_experience',\n IncorrectVehicleCondition = 'incorrect_vehicle_condition',\n NoStock = 'not_enough_stock',\n SlowDelivery = 'slow_delivery',\n HighDeposit = 'deposit_too_high',\n NoAnswer = 'client_not_answered',\n Automatic = 'automatic',\n LeasingDeal = 'sold-via-leasing',\n InvestmentPostponed = 'investment_postponed',\n /** The target-tenant deal released the vehicle (lost, or its reservation expired). */\n IntercompanyReleased = 'intercompany_released',\n}\n\ntype BaseBid = {\n vehicleId: string;\n opportunityId?: string;\n contactId: string;\n amount: string;\n};\n\nexport type NewBid = BaseBid & {};\n\nexport type Bid = BaseBid & {\n id: string;\n createdAt: string;\n createdBy: string;\n};\n\n/**\n * Provenance of a customer deal whose vehicle is fulfilled by a source-tenant intercompany\n * opportunity. Written only by the intercompany coordination\n * (cross-tenant-sync/ico-opportunities);\n * the link table at the source is its mirror. Powers deep links, the payments walk and\n * support digging — never availability decisions.\n */\nexport type OpportunityIntercompanyInfo = {\n sourceTenantId: string;\n sourceBranchId: string;\n sourceOpportunityId: string;\n sourceReservationId: string;\n};\n\ntype BaseOpportunity = {\n accountManager?: string;\n administrativePerson?: string;\n type: OpportunityType;\n organizationId?: string;\n contactId?: string;\n vehicleId?: string;\n source?: string; // e.g. website, autoscout, mobile...\n branch: string;\n inquiry?: string;\n branchCountry: string;\n intercompany?: OpportunityIntercompanyInfo;\n};\n\n// type, branch and branchCountry are optional: when omitted, the server defaults them\n// from the requester's preferred branches/opportunity types, then the tenant defaults.\nexport type NewOpportunity = Omit<BaseOpportunity, 'type' | 'branch' | 'branchCountry'> &\n Partial<Pick<BaseOpportunity, 'type' | 'branch' | 'branchCountry'>> & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n };\n\nexport enum VehicleSaleDealStatus {\n SaleAgreed = 'SALE_AGREED',\n FirstPaymentReceived = 'FIRST_PAYMENT_RECEIVED',\n FullPaymentReceived = 'FULL_PAYMENT_RECEIVED',\n}\n\nexport enum VehicleSaleLogisticsStatus {\n AtOrigin = 'AT_ORIGIN',\n Delivered = 'DELIVERED',\n}\n\nexport type Opportunity = BaseOpportunity & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n engagedAt?: string;\n engagedBy?: string;\n validatedAt?: string;\n validatedBy?: string;\n acceptedAt?: string;\n acceptedBy?: string;\n firstAcceptedAt?: string;\n lastActivityAt?: string; // last time we reached out to the customer, regardless of medium\n reviewedAt?: string;\n reviewedBy?: string;\n preparedAt?: string;\n preparedBy?: string;\n lastBidAt?: string;\n lostAt?: string;\n lostBy?: string;\n wonAt?: string;\n lostReason?: OpportunityLostReasonValues;\n deliveredAt?: string;\n deliveredBy?: string;\n deliveredMode?: 'CMR' | 'Action' | 'DeliveryConfirmation';\n saleDeliveryTransportEligibleAt?: string;\n status: OpportunityStatus;\n dealStatus?: VehicleSaleDealStatus;\n logisticStatus?: VehicleSaleLogisticsStatus;\n activeQuoteId?: string;\n amount?: string;\n documents?: Document[];\n leasingContractId?: string;\n internalLeasingContractId?: string;\n accountManagerAssistant?: string;\n requirementsOverride?: {\n [code: string]: { override: true; reason?: string; actionAt: string; actionBy: string };\n };\n};\n\nexport type OpportunityUpdate = {\n vehicleId?: string | null;\n accountManager?: string | null;\n accountManagerAssistant?: string | null;\n administrativePerson?: string | null;\n contactId?: string | null;\n activeQuoteId?: string | null;\n reviewed?: boolean;\n prepared?: boolean;\n lost?: boolean;\n delivered?: boolean;\n lostReason?: OpportunityLostReasonValues;\n documents?: Document[];\n branch?: string;\n branchCountry?: string;\n type?: OpportunityType;\n lastActivityAt?: string | null; // null gives the possibility to delete this field if all activities are deleted\n lastBidAt?: string;\n source?: string | null;\n requirementsOverride?: {\n [code: string]: { override: true; reason?: string; actionAt: string; actionBy: string };\n };\n};\n\nexport type OpportunityPaymentSummary = {\n /** Branch currency. */\n total: string;\n /** Sum of `amount` over the payments, in branch currency. */\n paid: string;\n /**\n * The same pair in the quote's alternative currency, present when the branch can be paid in it.\n * `paid` sums the payments that arrived in that currency.\n */\n foreign?: {\n total: string;\n paid: string;\n currencyCode: string;\n exchangeRate: string;\n };\n /** Fully paid when either currency reaches its total. */\n status: OpportunityPaymentStatus;\n percentagePaid: string;\n entries: DataRecord<OpportunityPayment>[];\n};\n\n/** @deprecated Renamed to {@link OpportunityPaymentSummary}. */\nexport type PaymentSummary = OpportunityPaymentSummary;\n\nexport type VehicleBffMetadata = {\n openOpportunities: number;\n otherRelatedVehicleIds: string[];\n};\n\nexport type OpportunityStatusRequirement = { code: OpportunityRequirementsCode; title?: string };\n\ntype OportunityWarningActionLink = {\n businessEntityId: BusinessEntityIds;\n recordId: string;\n /**\n * Absolute URL, set only when the record lives at another tenant — in-app routing cannot\n * reach it, so the client opens it in a new tab. Same shape the intercompany payments walk\n * already hands the client (ADR-0024's `opportunityUrl`).\n */\n url?: string;\n};\n\ntype OportunityWarningActionData = { [key: string]: string | number };\n\nexport type OpportunityWarning = {\n code: OpportunityWarningsCode;\n level: WarningHints;\n link?: OportunityWarningActionLink;\n data?: OportunityWarningActionData;\n showAction?: boolean;\n};\n\nexport enum OpportunityActionBlockerCode {\n MISSING_CUSTOMER = 'missing_customer',\n VEHICLE_BRANCH_MISMATCH = 'vehicle_branch_mismatch',\n MINIMUM_PAYMENT_MISSING = 'minimum_payment_missing',\n MISSING_FINANCING = 'missing_financing',\n BLOCKING_TASKS = 'blocking_tasks',\n}\n\nexport type OpportunityActionBlocker = {\n code: OpportunityActionBlockerCode;\n data?: OportunityWarningActionData;\n};\n\n/**\n * Why an action the user would otherwise expect to see is refused right now. Only actions whose\n * remaining conditions the user can act on are listed: a wrong status or a missing role hides the\n * action instead, as before.\n */\nexport type OpportunityBlockedAction = {\n action: OpportunityActions;\n reasons: OpportunityActionBlocker[];\n};\n\nexport type OpportunityBffMeta = ReferenceData & {\n requirements: OpportunityStatusRequirement[];\n warnings: OpportunityWarning[];\n blockedActions: OpportunityBlockedAction[];\n};\n\nexport type ContactMetdata = {\n openOpportunities: number;\n};\n\nexport type OpportunityBFF = {\n opportunity: DataRecord<Opportunity, OpportunityBffMeta>;\n vehicle?: DataRecord<Vehicle, VehicleBffMetadata>;\n interest?: DataRecord<Interest, InterestBffMeta>;\n bids: DataRecord<Bid>[];\n /** Every quote the deal has ever had; the ones it has left carry `meta.archived`. */\n quotes: DataRecord<Quote, QuoteRecordMeta>[];\n activeQuote?: DataRecord<Quote, QuoteRecordMeta>;\n payments: OpportunityPaymentSummary | undefined;\n reservation?: DataRecord<OpportunityReservation>;\n tasks: DataRecord<Task>[];\n customer?: {\n contact: DataRecord<Contact, ContactMetdata>;\n org?: DataRecord<Organization>;\n };\n transport?: Transport;\n};\n\ntype BaseOpportunityEvent = BaseEvent & {\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type OpportunityCreateEvent = BaseOpportunityEvent & {\n opportunity: Opportunity;\n previousOpportunity?: undefined;\n action: 'create';\n};\n\nexport type OpportunityUpdateEvent = BaseOpportunityEvent & {\n opportunity: Opportunity;\n previousOpportunity: Opportunity;\n action: 'update';\n};\n\nexport type OpportunityEvent = OpportunityCreateEvent | OpportunityUpdateEvent;\n\nexport type QuoteEvent = {\n quote: Quote;\n opportunity: Opportunity;\n action: 'create' | 'update';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\n/* Quote summary with information that should be common to different types of quotes */\nexport type QuoteInfo = {\n status: QuoteStatus;\n roi: string;\n id: string;\n // Leasing-only metrics, denormalized from the active leasing quote so the leasing report\n // can take medians without re-reading each quote. Absent on non-leasing quotes.\n /** Leasing term in months (`calculatorInput.leasing.duration`). */\n durationMonths?: number;\n /** Yearly ROI as a percentage 0–100 (`calculatorOutput.roi.perYear`). */\n roiPerYear?: number;\n /** Advance (deposit) as a percentage 0–100 (`calculatorInput.leasing.depositPercentage`). */\n advancePercentage?: number;\n};\n\nexport type SearchOpportunity = {\n contact?: Contact;\n opportunity: Opportunity;\n org?: Organization;\n vehicle?: Vehicle;\n transport?: Transport;\n quote?: QuoteInfo;\n custom: {\n groupKey: string;\n web2Lead: boolean;\n payment: { status: OpportunityPaymentStatus; percentagePaid: string };\n unassigned: boolean;\n lost: boolean;\n assignees: string[];\n accountManagers: string[];\n vehicleCheckedIn: boolean;\n status: OpportunityStatus | 'won';\n // Denormalized at indexing time from VehiclePurchase.log.checkedInAt so the opp index\n // can answer \"how long has this vehicle been visible on the website\" without joining.\n checkedInAt?: string;\n // Calendar days from min(marketingAt, evaluationAt, purchaseAgreedAt) until validatedAt.\n // Mirrors `daysInVirtualInventory` on the vehicle Business Overview page.\n daysAvailable?: number;\n // Operational supplier for reporting. For SLB clones this is the source vehicle supplier,\n // not the bank supplier on the clone purchase.\n realSupplierId?: string;\n // Branch of the associated vehicle, coalesced from the synced original branch then the\n // local branch — mirrors the vehicle index `custom.originalBranchId` facet.\n originalBranchId?: string;\n };\n};\n\nexport const QUOTE_NEEDS_VALIDATION_NOTIFICATION_ORIGIN = 'quote-validation';\nexport const QUOTE_NOT_CREATED_BY_ACCOUNT_MANAGER = 'quote-not-created-by-account-manager';\nexport const QUOTE_VALIDATOR_FEEDBACK_NOTIFICATION_ORIGIN = 'quote-validation-feedback';\n\nexport const OPPORTUNITY_ASSIGNED_NOTIFICATION_ORIGIN = 'opportunity-assigned';\nexport const OPPORTUNITY_VEHICLE_AVAILABLE_NOTIFICATION_ORIGIN = 'opportunity-vehicle-available';\nexport const OPPORTUNITY_VEHICLE_DELIVERY_NOTIFICATION_ORIGIN = 'opportunity-vehicle-delivery';\nexport const OPPORTUNITY_VEHICLE_RESERVATION_ABOUT_TO_EXPIRE_NOTIFICATION_ORIGIN =\n 'opportunity-vehicle-reservation-to-expire';\nexport const OPPORTUNITY_VEHICLE_RESERVATION_EXPIRED_NOTIFICATION_ORIGIN =\n 'opportunity-vehicle-reservation-expired';\nexport const INTERCOMPANY_OPPORTUNITY_RELEASED_NOTIFICATION_ORIGIN =\n 'intercompany-opportunity-released';\n\nexport const OFFER_SET_FINAL_VALUATION_ORIGIN = 'offer-set-final-valuation';\n\nexport const VEHICLE_PRICE_DECREASES_NOTIFICATION_ORIGIN = 'vehicle-price-decreased';\nexport const VEHICLE_ARRIVED_NOTIFICATION_ORIGIN = 'vehicle-arrived';\nexport const VEHICLE_CHECKEDIN_NOTIFICATION_ORIGIN = 'vehicle-checkedin';\nexport const VEHICLE_FULLY_PAID_NOTIFICATION_ORIGIN = 'vehicle-fully-paid';\nexport const VEHICLE_PURCHASED_NOTIFICATION_ORIGIN = 'vehicle-purchased';\nexport const VEHICLE_PRICE_CHANGED_NOTIFICATION_ORIGIN = 'vehicle-price-changed';\nexport const VEHICLE_SOLD_NOTIFICATION_ORIGIN = 'vehicle-sold';\n\nexport type OpportunityNotificationData = {\n quoteVersion?: number;\n snippet?: string;\n};\n\n/**\n * The fields of an opportunity that the kanban board's cards show. The kanban search returns\n * only these, so a card reading a field outside this list gets nothing.\n */\nexport const KANBAN_OPPORTUNITY_ITEM_FIELDS = [\n 'opportunity.id',\n 'opportunity.status',\n 'opportunity.amount',\n 'opportunity.accountManager',\n 'opportunity.accountManagerAssistant',\n 'opportunity.administrativePerson',\n 'opportunity.createdAt',\n 'opportunity.acceptedAt',\n 'opportunity.reviewedAt',\n 'opportunity.deliveredAt',\n 'opportunity.lastActivityAt',\n 'opportunity.lostAt',\n 'custom.web2Lead',\n 'custom.payment.percentagePaid',\n 'org.id',\n 'org.name',\n 'org.countryCode',\n 'contact.id',\n 'contact.firstName',\n 'contact.lastName',\n 'contact.countryCode',\n 'vehicle.id',\n 'vehicle.internal.identification.stockNumber',\n 'vehicle.internal.identification.administrativeNumber',\n 'vehicle.internal.description.title',\n 'vehicle.external.mainPicture.url',\n 'transport.status',\n] as const satisfies readonly FieldId<SearchOpportunity>[];\n\n/** An opportunity on the kanban board: its search document cut down to the card's fields. */\nexport type KanbanOpportunityItem = PickFieldIds<\n SearchOpportunity,\n (typeof KANBAN_OPPORTUNITY_ITEM_FIELDS)[number]\n>;\n\nexport type KanbanOpportunityGroup = {\n items: KanbanOpportunityItem[];\n};\n\nexport type OpportunitiesKanbanColumn = {\n status: string;\n results: KanbanOpportunityItem[];\n groups?: KanbanOpportunityGroup[];\n totalCount: number;\n totalValue: string;\n};\n\nexport type MSearchOpportunitiesKanbanColumn = {\n column: OpportunitiesKanbanColumn;\n nextToken?: string;\n};\n\ntype HpLeasingDealRunDataBase = {\n bisondeskTenantId: string;\n entityOwner: string;\n opportunityId: string;\n};\n\n// Field ids match the hpaci (Mr Lease CI) leasing-deal process definition: the LD is the only\n// Hyperportal process for that tenant (no C flow) and the contract document lives in BisonDesk.\nexport type HpLeasingDealRunDataCi = HpLeasingDealRunDataBase & {\n client?: string;\n vendeur?: string;\n vehicule?: string;\n plaqueDimmatriculation?: string;\n numeroDeContratLeasing: string;\n dateDeDebutDuContrat?: number;\n prixDeVenteHorsTvaXof: string;\n montantDavanceTtcXof: string;\n depotDeGarantieXof?: string;\n dueeDuLeasingEnMois: number;\n travauxHorsNormesNecessaire: boolean;\n descriptionDesTravauxHorsNormes: string;\n};\n\nexport type HpLeasingDealRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: HpLeasingDealRunDataDefault | HpLeasingDealRunDataCi;\n};\n\nexport type HpLeasingDealRunDataDefault = HpLeasingDealRunDataBase & {\n leasingContractOwner?: string;\n foreseenDeliveryDate?: string;\n deliveryAddressLeasing?: string;\n nameSalesPerson: string;\n durationLeasingInMonths: number;\n vanCourier: boolean;\n newVehicle?: boolean;\n newTrailer?: boolean;\n registrationOnTtcoBe?: boolean;\n externalDelivery?: boolean;\n civilLiabilities?: boolean;\n specialTechnicalInsurance?: boolean;\n allRisks?: boolean;\n roadAssistance?: boolean;\n vabAssistanceVan?: boolean;\n yearOfConstruction?: number;\n chassisnumber?: string;\n vehicleModel?: string;\n vehicleCategory2?: string;\n licencePlate?: string;\n vatPercentage?: number;\n\n opportunityContractId: string;\n\n company?: string;\n customerNumber?: number; //bisondesk external id\n slbPartner?: string;\n //MrLease fields\n vehicle?: string;\n vehicleNewReferenceMl?: string;\n referencePurchaserTtcoKleyn?: string;\n salesPriceEur: string;\n depositFullAmountExclVat: string;\n depositToBePrepaidExclVat: string;\n vehicleMake3?: string;\n\n //TTC fields\n vehicleOriginalReference?: string;\n salesPrice: string;\n depositFullAmount: string;\n depositAmountToBePrepaid: string;\n make?: string;\n\n //Extras\n garageExtrasCodes: string[];\n allExtrasDescriptions: string[];\n administrationExtrasCodes: string[];\n logisticExtrasCodes: string[];\n customRequestDescriptions: string[];\n};\n\nexport type HpLeasingDealResponse = {\n entityId: string;\n id: string;\n status: string;\n leasingContractNumber?: string;\n};\n\nexport type HpLeasingContractRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n bisondeskTenantId: string;\n entityOwner: string;\n leasingContractOwner?: string;\n totalLeasingAmount: string;\n company?: string;\n vehicle?: string;\n ldNumber: number;\n vanCourier: boolean;\n startDate: number;\n opportunityContractId: string;\n maxKmPerYear?: number;\n data: {\n leasingParameter: {\n allRisksPercentage: number;\n allRisksTaxPercentage: number;\n civilLiability: number;\n entityId: string;\n oneTimeRoadTax: number;\n specialInsurance: number;\n yearlyRoadTax: number;\n countries: string[];\n vehicleCategory: string;\n };\n\n calculatorRequest: {\n bankDeposit: number;\n bankDurationInMonths: number;\n bankInterestRatePercentage: number;\n bankResidualValue: number;\n deposit: number;\n durationInMonths: number;\n includesAllRisks: boolean;\n includesCivilLiability: boolean;\n includesOneTimeRoadTax: boolean;\n includesSpecialInsurance: boolean;\n includesYearlyRoadTax: boolean;\n insuranceAmount: number;\n interestRatePercentage: number;\n marginPercentage: number;\n monthlyAdministrationFee: 0;\n purchasePrice: number;\n residualValue: number;\n salesPrice: number;\n startupFeePercentage: number;\n };\n\n calculatorResponse: {\n ROI: number;\n ROIDifference: number;\n ROIPerYear: number;\n ROITarget: number;\n allRisksInsuranceAmount: number;\n bankContractValue: number;\n bankLeasingAmount: number;\n cashDeficit: number;\n financingAmount: number;\n leasingAmount: number;\n leasingContractValue: number;\n leasingProfit: number;\n monthlyTaxRetailPrice: number;\n oneTimeTaxCost: number;\n totalMonthlyPayment: number;\n totalProfit: number;\n vehicleProfit: number;\n };\n\n cashInValues: CashInRow[];\n\n cashOutValues: CashOutRow[];\n };\n };\n};\n\nexport type HpLeasingContractResponse = {\n entityId: string;\n id: string;\n status: string;\n createdAt: string;\n updatedAt: string;\n dateOfFinalSettlement: string;\n startDate: string;\n email: string;\n contractNumber: string;\n};\n\nexport type HpLeasingDealReturnRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n bisondeskTenantId: string;\n entityOwner: string;\n leasingContractNumber2: string;\n leasingContractNumber: string;\n opportunityContractId: string;\n company: string;\n vehicle: string;\n };\n};\n\nexport type HpLeasingDealEndRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n bisondeskTenantId: string;\n entityOwner: string;\n leasingContractOwner: string;\n vehicleOldReference: string;\n leasingContractNumber: string;\n company: string;\n vehicleNewReference: string;\n };\n};\n\nexport type CashInRow = {\n time: number;\n deposit: number;\n monthlyAdministrationFee: 0; //Legacy field - Should always be 0\n residualValue: number;\n startupFee: number;\n leasingAmountWithoutAdminFee: number;\n insurancePayment: number;\n taxPayment: number;\n cashIn: number;\n cumulativeCash: number;\n};\n\nexport type CashOutRow = {\n time: number;\n deposit: number;\n residualValue: number;\n leasingAmount: number;\n insurancePayment: number;\n taxPayment: number;\n cashOut: number;\n cumulativeCash: number;\n};\n\nexport type HpDeliveryFields = {\n detailsOfStacking?: string | null;\n technicalControlNeeded: boolean | null;\n\n //PickUP Delivery\n urgentDelivery?: boolean | null;\n dateOfPickUpByCustomer?: number | null;\n modeOfTransportPickUpByCustomer?: string | null; //entity Id\n detailsOfBorderCrossing?: string | null;\n insuranceNeeded: boolean | null;\n transitPlateNeeded: boolean | null;\n licensePlateNeeded: boolean | null;\n\n //Address Delivery\n address?: string | null;\n kmToAddressOfDelivery?: number | null;\n\n //To Port Delivery\n originPortText?: string | null; //entity Id\n shippingCompany?: string | null; //string Id\n destinationPort?: string | null;\n cleaningDegassingNeeded: boolean | null;\n};\n\nexport type HpIsaProcessRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: HpDeliveryFields & {\n entityOwner: string;\n nameSalesPerson: string;\n\n company?: string; //entityId\n proofOfSaleCustomerAgreement?: string; //entityId\n\n vehicle?: string; //entityId\n bodywork?: string; //entityId\n vehicleCategory: string; //entityId\n\n amountOfCommissionPaid: number;\n opportunityId: string;\n deliveryType: string; //entity Id\n directDelivery?: boolean | null;\n directDeliveryReason?: string | null;\n agreedPrice?: string;\n\n //Extras\n garageExtrasCodes: string[];\n logisticsExtrasCodes: string[];\n administrationExtrasCodes: string[];\n allExtrasDescriptions: string[];\n customRequestDescriptions: string[];\n infoSpoiler: string; // entity Id\n };\n};\n\nexport type HpIsaProcessResponse = {\n entityId: string;\n id: string;\n status: string;\n};\n\nexport type HpWorkOrderProcessRequest = {\n tenantId: string;\n initiatedBy: 'bisondesk';\n processMetaId: string;\n processRunData: {\n entityOwner: string;\n\n opportunityId: string;\n\n //Extras\n garageExtrasCodes: string[];\n allExtrasDescriptions: string[];\n\n customerRequestDescriptions: string[];\n directDeliveryReason?: string | null;\n salesPerson: string; // entityId\n customerName: string;\n referenceNumber: string;\n make?: string; //entityId\n typeTrailer?: string; //entityId\n\n vinNumber?: string;\n foreseenArrivalDateTrailer?: string;\n deadlineRequest?: number;\n locationVehicle2?: string; //entityId\n customer: string; //entityId\n vehicle: string; //entityId\n trailerHasBeenCheckedIn: boolean;\n deliveryDetails?: string | null;\n technicalInspectionNeeded: boolean | null;\n adr: boolean | null;\n };\n};\n\nexport type HpWorkOrderProcessResponse = {\n entityId: string;\n id: string;\n status: string;\n};\n\nexport type SwitchOpportunityVehicleRequest = {\n opportunity: Opportunity;\n newVehicleId: string;\n};\n\nexport type KanbanOpportunitiesSearchRequest = BaseSearchRequest & {\n nextTokens?: Record<string, string | undefined>;\n groupByClient?: boolean;\n};\n\nexport type KanbanOpportunitiesNextList = Omit<\n NextList<OpportunitiesKanbanColumn, ReferenceData>,\n 'nextToken'\n> & {\n nextTokens?: Record<string, string | undefined>;\n};\n"]}
|
|
@@ -4,6 +4,12 @@ export declare enum OpportunityPaymentActions {
|
|
|
4
4
|
EDIT = "edit"
|
|
5
5
|
}
|
|
6
6
|
export declare const OPPORTUNITY_PAYMENT_NOTIFICATION_ORIGIN = "opportunity-payment-notification";
|
|
7
|
+
export type OpportunityPaymentForeign = {
|
|
8
|
+
amount: string;
|
|
9
|
+
currencyCode: string;
|
|
10
|
+
exchangeRate: string;
|
|
11
|
+
};
|
|
12
|
+
export type OpportunityPaymentForeignRequest = Pick<OpportunityPaymentForeign, 'amount' | 'currencyCode'>;
|
|
7
13
|
type BaseOpportunityPayment = {
|
|
8
14
|
opportunityId: string;
|
|
9
15
|
amount: string;
|
|
@@ -20,6 +26,7 @@ export type NewOpportunityPayment = BaseOpportunityPayment & {
|
|
|
20
26
|
deletedAt?: undefined;
|
|
21
27
|
deletedBy?: undefined;
|
|
22
28
|
paidAt: string;
|
|
29
|
+
foreign?: OpportunityPaymentForeignRequest;
|
|
23
30
|
};
|
|
24
31
|
export type OpportunityPayment = BaseOpportunityPayment & {
|
|
25
32
|
id: string;
|
|
@@ -30,10 +37,12 @@ export type OpportunityPayment = BaseOpportunityPayment & {
|
|
|
30
37
|
deletedAt?: string;
|
|
31
38
|
deletedBy?: string;
|
|
32
39
|
paidAt?: string;
|
|
40
|
+
foreign?: OpportunityPaymentForeign;
|
|
33
41
|
};
|
|
34
42
|
export type OpportunityPaymentUpdate = {
|
|
35
43
|
description?: string;
|
|
36
44
|
amount?: string;
|
|
45
|
+
foreign?: OpportunityPaymentForeignRequest | null;
|
|
37
46
|
paidAt?: string;
|
|
38
47
|
};
|
|
39
48
|
export type OpportunityPaymentCreateEvent = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opportunity-payments.d.ts","sourceRoot":"/","sources":["types/opportunity-payments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,oBAAY,yBAAyB;IACnC,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,eAAO,MAAM,uCAAuC,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"opportunity-payments.d.ts","sourceRoot":"/","sources":["types/opportunity-payments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,oBAAY,yBAAyB;IACnC,MAAM,WAAW;IACj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;AAHD,WAAY,yBAAyB;IACnC,8CAAiB,CAAA;IACjB,0CAAa,CAAA;AACf,CAAC,EAHW,yBAAyB,KAAzB,yBAAyB,QAGpC;AAED,MAAM,CAAC,MAAM,uCAAuC,GAAG,kCAAkC,CAAC","sourcesContent":["import { BaseEvent } from './internal-events.js';\n\nexport enum OpportunityPaymentActions {\n DELETE = 'delete',\n EDIT = 'edit',\n}\n\nexport const OPPORTUNITY_PAYMENT_NOTIFICATION_ORIGIN = 'opportunity-payment-notification';\n\ntype BaseOpportunityPayment = {\n opportunityId: string;\n amount: string;\n description?: string;\n vehicleId: string;\n organizationId: string;\n};\n\nexport type NewOpportunityPayment = BaseOpportunityPayment & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n deletedAt?: undefined;\n deletedBy?: undefined;\n paidAt: string;\n};\n\nexport type OpportunityPayment = BaseOpportunityPayment & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n deletedAt?: string;\n deletedBy?: string;\n paidAt?: string;\n};\n\nexport type OpportunityPaymentUpdate = {\n description?: string;\n amount?: string;\n paidAt?: string;\n};\n\nexport type OpportunityPaymentCreateEvent = {\n payment: OpportunityPayment;\n previousPayment?: undefined;\n action: 'create';\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n};\n\nexport type OpportunityPaymentUpdateEvent = {\n payment: OpportunityPayment;\n previousPayment: OpportunityPayment;\n action: 'update';\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n};\n\nexport type OpportunityPaymentDeleteEvent = {\n payment?: undefined;\n previousPayment: OpportunityPayment;\n action: 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n};\n\nexport type OpportunityPaymentEvent = BaseEvent &\n (OpportunityPaymentCreateEvent | OpportunityPaymentUpdateEvent | OpportunityPaymentDeleteEvent);\n"]}
|
|
1
|
+
{"version":3,"file":"opportunity-payments.js","sourceRoot":"/","sources":["types/opportunity-payments.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACnC,8CAAiB,CAAA;IACjB,0CAAa,CAAA;AACf,CAAC,EAHW,yBAAyB,KAAzB,yBAAyB,QAGpC;AAED,MAAM,CAAC,MAAM,uCAAuC,GAAG,kCAAkC,CAAC","sourcesContent":["import { BaseEvent } from './internal-events.js';\n\nexport enum OpportunityPaymentActions {\n DELETE = 'delete',\n EDIT = 'edit',\n}\n\nexport const OPPORTUNITY_PAYMENT_NOTIFICATION_ORIGIN = 'opportunity-payment-notification';\n\n/**\n * The money as it arrived, when it arrived in the quote's alternative currency. `amount` then\n * holds its value in branch currency: `foreign.amount × foreign.exchangeRate`.\n */\nexport type OpportunityPaymentForeign = {\n amount: string;\n currencyCode: string;\n /** Branch currency units per 1 unit of `currencyCode`, the quote's rate. */\n exchangeRate: string;\n};\n\n/** What a user sends for a payment in another currency. The backend takes the rate from the quote\n * and derives `amount`. */\nexport type OpportunityPaymentForeignRequest = Pick<\n OpportunityPaymentForeign,\n 'amount' | 'currencyCode'\n>;\n\ntype BaseOpportunityPayment = {\n opportunityId: string;\n /** Branch currency. */\n amount: string;\n description?: string;\n vehicleId: string;\n organizationId: string;\n};\n\nexport type NewOpportunityPayment = BaseOpportunityPayment & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n deletedAt?: undefined;\n deletedBy?: undefined;\n paidAt: string;\n foreign?: OpportunityPaymentForeignRequest;\n};\n\nexport type OpportunityPayment = BaseOpportunityPayment & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n deletedAt?: string;\n deletedBy?: string;\n paidAt?: string;\n foreign?: OpportunityPaymentForeign;\n};\n\nexport type OpportunityPaymentUpdate = {\n description?: string;\n amount?: string;\n /** `null` turns the payment back into a branch currency payment. */\n foreign?: OpportunityPaymentForeignRequest | null;\n paidAt?: string;\n};\n\nexport type OpportunityPaymentCreateEvent = {\n payment: OpportunityPayment;\n previousPayment?: undefined;\n action: 'create';\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n};\n\nexport type OpportunityPaymentUpdateEvent = {\n payment: OpportunityPayment;\n previousPayment: OpportunityPayment;\n action: 'update';\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n};\n\nexport type OpportunityPaymentDeleteEvent = {\n payment?: undefined;\n previousPayment: OpportunityPayment;\n action: 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n branchId: string;\n};\n\nexport type OpportunityPaymentEvent = BaseEvent &\n (OpportunityPaymentCreateEvent | OpportunityPaymentUpdateEvent | OpportunityPaymentDeleteEvent);\n"]}
|
|
@@ -84,6 +84,7 @@ export type LeasingQuoteParams<P extends CountrySpecificQuoteParams = CountrySpe
|
|
|
84
84
|
leasingDuration: number;
|
|
85
85
|
leasingDepositPercentage: string;
|
|
86
86
|
leasingResidualValuePercentage: string;
|
|
87
|
+
maxKmPerYear?: number;
|
|
87
88
|
};
|
|
88
89
|
costs: {
|
|
89
90
|
bankDepositPercentage: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote-settings.d.ts","sourceRoot":"/","sources":["types/quote-settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAExD,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG;IACxD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,IAAI,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,cAAc,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,WAAW,EAAE,IAAI,CAAC;IAClB,KAAK,EAAE,iBA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AA2B,EAAE,MAAM,CAAC;KACrC,CAAC;CACH,GAAG,CAAC,CAAC;AAER,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG,uBAAuB,CAAC;AAEzE,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CAClC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote-settings.js","sourceRoot":"/","sources":["types/quote-settings.ts"],"names":[],"mappings":"","sourcesContent":["import { Categories } from '../constants.js';\nimport { DeliveryParams } from './delivery-settings.js';\n\nexport type UsedVehiclesSalesParams = BaseQuoteSettings & {\n modifiedBy: string;\n countryCode: 'be';\n profitabilityDealGap: string;\n exaDocumentCosts: string;\n delivery?: DeliveryParams;\n};\n\nexport type BeSpecificQuoteParams = {\n countryCode: 'be';\n other: BaseQuoteSettings['other'] & {\n leasingStartupFeePercentage: string;\n };\n validationLimits?: {\n minimumInterestRate?: string;\n minimumDepositPercentage?: string;\n };\n insurance: {\n allRisksCost: string;\n allRisksTax: string;\n allRisksFees: string;\n allRisksMinimumCost: string;\n specialTechnicalInsuranceCost: string;\n specialTechnicalInsuranceTax: string;\n specialTechnicalInsuranceFees: string;\n civilLiabilitiesCost: string;\n civilLiabilitiesTax: string;\n civilLiabilitiesFees: string;\n roadAssistanceMonthlySalesPrice: string; // monthly Price\n roadAssistanceMonthlyCostPrice: string; // monthly Price\n margin: string;\n allRisksCheckedForLocalClients: boolean;\n specialTechnicalInsuranceCheckedForLocalClients: boolean;\n civilLiabilitiesCheckedForLocalClients: boolean;\n roadAssistanceCheckedForLocalClients: boolean;\n initialFractionPercentage: '0';\n };\n track: {\n trackAndTrace24Cost: string;\n trackAndTrace36Cost: string;\n trackAndTrace48Cost: string;\n trackAndTraceMaxCost: string;\n };\n taxes: {\n oneTimeRoadTax: string;\n yearlyRoadTax: string;\n oneTimeRoadCheckedForLocalClients: boolean;\n yearlyRoadCheckedForLocalClients: boolean;\n margin: string;\n };\n};\n\nexport type BoSpecificQuoteParams = {\n countryCode: 'bo';\n insurance: {\n allRisksCost: string;\n margin: string;\n initialFractionPercentage: string;\n };\n other: BaseQuoteSettings['other'] & {\n administrativeFee: string;\n };\n track: {\n installationCost: string;\n monthlyCost: string;\n monthlyFee: string;\n deviceCost: string;\n };\n};\n\nexport type CountrySpecificQuoteParams = BeSpecificQuoteParams | BoSpecificQuoteParams;\n\ntype BaseQuoteSettings = {\n id: string;\n priority: number; //1 is highest priority. The lower the number, the higher the priority\n category?: Categories;\n modifiedAt: string;\n name: string;\n other: {\n minimumDepositAdjudicationPercentage: string;\n };\n};\n\nexport type LeasingQuoteParams<P extends CountrySpecificQuoteParams = CountrySpecificQuoteParams> =\n BaseQuoteSettings & {\n leasing: {\n leasingInterestRate: string;\n leasingDuration: number;\n leasingDepositPercentage: string;\n leasingResidualValuePercentage: string;\n };\n costs: {\n bankDepositPercentage: string;\n bankInterestRate: string;\n bankResidualValuePercentage: string;\n };\n } & P;\n\nexport type QuoteSettings = LeasingQuoteParams | UsedVehiclesSalesParams;\n\nexport type QuoteParamsDropdown = {\n id: string;\n title: { [key: string]: string };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"quote-settings.js","sourceRoot":"/","sources":["types/quote-settings.ts"],"names":[],"mappings":"","sourcesContent":["import { Categories } from '../constants.js';\nimport { DeliveryParams } from './delivery-settings.js';\n\nexport type UsedVehiclesSalesParams = BaseQuoteSettings & {\n modifiedBy: string;\n countryCode: 'be';\n profitabilityDealGap: string;\n exaDocumentCosts: string;\n delivery?: DeliveryParams;\n};\n\nexport type BeSpecificQuoteParams = {\n countryCode: 'be';\n other: BaseQuoteSettings['other'] & {\n leasingStartupFeePercentage: string;\n };\n validationLimits?: {\n minimumInterestRate?: string;\n minimumDepositPercentage?: string;\n };\n insurance: {\n allRisksCost: string;\n allRisksTax: string;\n allRisksFees: string;\n allRisksMinimumCost: string;\n specialTechnicalInsuranceCost: string;\n specialTechnicalInsuranceTax: string;\n specialTechnicalInsuranceFees: string;\n civilLiabilitiesCost: string;\n civilLiabilitiesTax: string;\n civilLiabilitiesFees: string;\n roadAssistanceMonthlySalesPrice: string; // monthly Price\n roadAssistanceMonthlyCostPrice: string; // monthly Price\n margin: string;\n allRisksCheckedForLocalClients: boolean;\n specialTechnicalInsuranceCheckedForLocalClients: boolean;\n civilLiabilitiesCheckedForLocalClients: boolean;\n roadAssistanceCheckedForLocalClients: boolean;\n initialFractionPercentage: '0';\n };\n track: {\n trackAndTrace24Cost: string;\n trackAndTrace36Cost: string;\n trackAndTrace48Cost: string;\n trackAndTraceMaxCost: string;\n };\n taxes: {\n oneTimeRoadTax: string;\n yearlyRoadTax: string;\n oneTimeRoadCheckedForLocalClients: boolean;\n yearlyRoadCheckedForLocalClients: boolean;\n margin: string;\n };\n};\n\nexport type BoSpecificQuoteParams = {\n countryCode: 'bo';\n insurance: {\n allRisksCost: string;\n margin: string;\n initialFractionPercentage: string;\n };\n other: BaseQuoteSettings['other'] & {\n administrativeFee: string;\n };\n track: {\n installationCost: string;\n monthlyCost: string;\n monthlyFee: string;\n deviceCost: string;\n };\n};\n\nexport type CountrySpecificQuoteParams = BeSpecificQuoteParams | BoSpecificQuoteParams;\n\ntype BaseQuoteSettings = {\n id: string;\n priority: number; //1 is highest priority. The lower the number, the higher the priority\n category?: Categories;\n modifiedAt: string;\n name: string;\n other: {\n minimumDepositAdjudicationPercentage: string;\n };\n};\n\nexport type LeasingQuoteParams<P extends CountrySpecificQuoteParams = CountrySpecificQuoteParams> =\n BaseQuoteSettings & {\n leasing: {\n leasingInterestRate: string;\n leasingDuration: number;\n leasingDepositPercentage: string;\n leasingResidualValuePercentage: string;\n /** Seeds `leasing.maxKmPerYear` on new quotes. */\n maxKmPerYear?: number;\n };\n costs: {\n bankDepositPercentage: string;\n bankInterestRate: string;\n bankResidualValuePercentage: string;\n };\n } & P;\n\nexport type QuoteSettings = LeasingQuoteParams | UsedVehiclesSalesParams;\n\nexport type QuoteParamsDropdown = {\n id: string;\n title: { [key: string]: string };\n};\n"]}
|
package/lib/types/quotes.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotes.d.ts","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EACL,4BAA4B,EAC5B,0BAA0B,EAC1B,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAEjD,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,aAAa,kBAAkB;IAC/B,MAAM,WAAW;CAClB;AAED,oBAAY,WAAW;IACrB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,gBAAgB,oBAAoB;IACpC,gBAAgB,oBAAoB;CACrC;AAED,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;CACd;AACD,oBAAY,iBAAiB;IAC3B,aAAa,kBAAkB;IAC/B,gBAAgB,qBAAqB;CACtC;AAED,KAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,m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appings":"AAaA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,mDAAoC,CAAA;IACpC,mDAAoC,CAAA;AACtC,CAAC,EATW,WAAW,KAAX,WAAW,QAStB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AACD,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,0DAAqC,CAAA;AACvC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAsRD,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,sCAAiB,CAAA;AACnB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAoFD,OAAO,EACL,kBAAkB,IAAI,aAAa,EACnC,WAAW,EACX,kBAAkB,GACnB,MAAM,iBAAiB,CAAC","sourcesContent":["import { AttachmentValue } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\nimport { SalesDeliveryType } from './deliveries.js';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n SalesQuoteExtraInput,\n} from './leasing-settings.js';\nimport { MatchingRuleValue } from './roi-ratings.js';\nimport { PricePercentageMode } from './utils.js';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\n}\n\nexport enum QuoteStatus {\n CREATED = 'created',\n VALIDATED = 'validated',\n INVALIDATED = 'invalidated',\n ACCEPTED = 'accepted',\n REJECTED = 'rejected',\n CANCELLED = 'cancelled',\n MANAGER_REJECTED = 'managerRejected',\n MANAGER_ACCEPTED = 'managerAccepted',\n}\n\nexport enum QuoteMetricsScore {\n DANGER = 'danger',\n NEUTRAL = 'neutral',\n GOOD = 'good',\n}\nexport enum SelfFinancingType {\n OWN_FINANCING = 'own_financing',\n ALREADY_FINANCED = 'already_financed',\n}\n\ntype BaseQuoteCalculatorInput = {\n branchId: string;\n branchCountry: string;\n customerCountry: string;\n customerVatNumber?: string;\n currency: string;\n alternativeCurrency?: string;\n exchangeRate?: string;\n vehicle: {\n id: string;\n category: string;\n bodywork?: string;\n agreedPriceExclVat: string;\n technicalNotes?: string;\n vatRate: string;\n };\n\n allRisksCost?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type LeasingCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n deliveryPackage?: LeasingQuoteExtraInput;\n settingsId: string;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n externalDelivery: boolean;\n settingsId: string;\n isRefinancingDebt?: boolean; // if true, the insurance amounts might not be the same as the leasing amount + and other costs like track and trace\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n agreedPrice: string;\n purchasePrice: string;\n };\n leasing: {\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n startupFee: string;\n startupFeeMode: PricePercentageMode;\n startupFeePercentage: string;\n /** Returnable security deposit (dépôt de garantie): VAT-free, never financed. Not the advance (`deposit`). */\n guaranteeDeposit?: string;\n interestRate: string;\n duration: number;\n contractStartDate: string;\n };\n bank: {\n interestRate: string;\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n duration: number;\n salesPrice: string;\n internalDealBranchId?: string;\n } & (\n | { selfFinancing: true; selfFinancingType?: SelfFinancingType; financing?: undefined }\n | {\n selfFinancing: false;\n selfFinancingType?: undefined;\n financing?: { bankAccountOrganizationId: string; amount: string };\n }\n );\n taxes: {\n yearlyRoadTax: boolean;\n yearlyRoadTaxCustomAmount: string;\n oneTimeRoadTax: boolean;\n margin: string; //Non Editable, copies the value insurance > margin\n };\n insurance: {\n margin: string;\n civilLiabilities: boolean;\n allRisks: boolean;\n specialTechnicalInsurance: boolean;\n roadAssistance: boolean;\n initialFractionPercentage: string;\n insuredAmount?: string;\n };\n deliveryPackage?: LeasingDeliveryPackageInput;\n extras: LeasingQuoteExtraInput[];\n customRequests: CustomLeasingQuoteExtraInput[];\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type SalesCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n premiumPrice?: string;\n minimumPrice: string;\n internetPrice?: string;\n comissionCost: string;\n };\n delivery?: SalesDeliveryType;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n financing?: {\n organizationId: string;\n };\n};\n\nexport type SalesQuoteRuleInput = {\n minimumPrice?: number;\n internetPrice?: number;\n premiumPrice?: number;\n agreedPrice: number;\n stockAge: number;\n};\n\nexport type LeasingCalculatorOutput = {\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDeliveryExclVat: string;\n beforeDelivery: string;\n /** Portion of beforeDelivery that is the returnable guarantee deposit (VAT-free, not financed). */\n guaranteeDeposit?: string;\n financingAmount: string;\n settingId: string;\n totalRetailAmountExclVat: string;\n totalRetailAmount: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: string;\n finalSalesPrice: string;\n roi: {\n value: string;\n target: string;\n perYear: string;\n difference: string;\n score?: QuoteMetricsScore;\n };\n cashflow: {\n deficit: string;\n balanced: boolean;\n score: QuoteMetricsScore;\n };\n profitability: {\n leasing: string;\n vehicle: string;\n total: string;\n score: QuoteMetricsScore;\n };\n taxes: {\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n yearlyRoadTax: string;\n oneTimeRoadTax: string;\n profit: string;\n };\n insurance: {\n beforeDelivery: string;\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n profit: string;\n };\n trackAndTrace: {\n beforeDelivery: string;\n monthlyCost: string;\n installationCost: string; // currently this cost is being included as part of monthlyCost. In future, this will be a separate cost\n deviceCost: string; // same as above\n profit: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n };\n};\n\nexport type SalesCalculatorOutput = {\n totalRetailAmount: string;\n totalRetailAmountExclVat: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: string;\n retailAmounts: {\n vehicle: string;\n delivery: string;\n extras: string;\n };\n vehicle: {\n purchasePrice: string; //incl vat\n agreedPrice: string; // incl vat\n };\n roi: { value: string; score?: QuoteMetricsScore };\n profit: {\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n profitOverMin?: {\n // deprecated\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n delivery?: {\n retailPrice?: string;\n costPrice?: string;\n cleaningNeeded: boolean;\n cleaningNeededRetailPrice: string;\n transportationToPortRetailPrice?: string;\n };\n costs: {\n finalCostPrice: string;\n extras: string;\n delivery: string;\n };\n};\n\ntype BaseQuote = {\n opportunityId: string;\n preferredLanguage: string;\n clientNotes?: string;\n publicNotes?: string;\n} & (\n | {\n type: OpportunityType.LEASING;\n calculatorInput: LeasingCalculatorInput;\n calculatorOutput: LeasingCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.SALES;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.NEW_TRAILER | OpportunityType.NEW_TRAILER_NEW_PRODUCTION;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type:\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_OUTSOURCING\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_INSOURCING;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n);\n\nexport type NewQuote = BaseQuote & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n active: true;\n};\n\n/**\n * A field of the linkage a quote is written against — opportunity, vehicle, contact, type and\n * branch. When one of them is edited on the deal, the deal moves to a new linkage and its\n * earlier quotes stay behind on the old one rather than following.\n */\nexport enum QuoteLinkageField {\n Vehicle = 'vehicle',\n Contact = 'contact',\n Type = 'type',\n Branch = 'branch',\n}\n\nexport type QuoteRecordMeta = {\n /**\n * The quote was computed for a linkage the deal has since left. Kept visible as history: its\n * figures were right for the vehicle, customer and branch of the day, and are not right now,\n * so the only thing left to do with it is read the PDF that was sent.\n */\n archived?: boolean;\n /** Why: the linkage fields edited on the deal since this quote was written. */\n archivedReason?: QuoteLinkageField[];\n};\n\nexport type Quote = BaseQuote & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n validationBy?: string;\n validationAt?: string;\n cancelledBy?: string;\n cancelledAt?: string;\n customerFeedbackAt?: string;\n customerFeedbackBy?: string;\n managerFeedbackAt?: string;\n managerFeedbackBy?: string;\n version: number;\n status: QuoteStatus;\n proformaPdf?: AttachmentValue;\n quotePdf?: AttachmentValue;\n salesAgreementPdf?: AttachmentValue;\n active: boolean;\n contactId: string;\n vehicleId: string;\n organizationId: string;\n technicalNotesUpdated: boolean;\n technicalNotesValidated: boolean;\n technicalNotesValidatedAt?: string;\n technicalNotesValidatedBy?: string;\n externalQuote?: boolean;\n};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: boolean;\n technicalNotesValidated?: boolean;\n};\n\nexport type CalculatorLeasingIO = {\n output: LeasingCalculatorOutput;\n input: LeasingCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorSalesIO = {\n output: SalesCalculatorOutput;\n input: SalesCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorQuoteIO = CalculatorLeasingIO | CalculatorSalesIO;\n\nexport type NewQuoteValidator = {\n userId: string;\n countryCode: string;\n type: OpportunityType;\n canValidateOwn?: boolean;\n};\n\nexport type QuoteValidator = NewQuoteValidator & {\n createdAt: string;\n};\n\nexport type QuoteValidatorUpdate = {\n canValidateOwn: boolean;\n};\n\nexport type {\n AddressDeliveryType,\n DeliveryLocationValue,\n DeliveryRoutesRequest,\n PickUpDeliveryType,\n PortDeliverytype,\n} from './deliveries.js';\n/** @deprecated Import delivery types from ./deliveries.js. */\nexport {\n SalesDeliveryTypes as DeliveryTypes,\n SpoilerInfo,\n TransportationMode,\n} from './deliveries.js';\n"]}
|
|
1
|
+
{"version":3,"file":"quotes.js","sourceRoot":"/","sources":["types/quotes.ts"],"names":[],"mappings":"AAaA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAED,MAAM,CAAN,IAAY,WASX;AATD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;IACvB,0CAA2B,CAAA;IAC3B,oCAAqB,CAAA;IACrB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,mDAAoC,CAAA;IACpC,mDAAoC,CAAA;AACtC,CAAC,EATW,WAAW,KAAX,WAAW,QAStB;AAED,MAAM,CAAN,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;AACf,CAAC,EAJW,iBAAiB,KAAjB,iBAAiB,QAI5B;AACD,MAAM,CAAN,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oDAA+B,CAAA;IAC/B,0DAAqC,CAAA;AACvC,CAAC,EAHW,iBAAiB,KAAjB,iBAAiB,QAG5B;AAwRD,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;IACnB,kCAAa,CAAA;IACb,sCAAiB,CAAA;AACnB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAoFD,OAAO,EACL,kBAAkB,IAAI,aAAa,EACnC,WAAW,EACX,kBAAkB,GACnB,MAAM,iBAAiB,CAAC","sourcesContent":["import { AttachmentValue } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\nimport { SalesDeliveryType } from './deliveries.js';\nimport {\n CustomLeasingQuoteExtraInput,\n CustomSalesQuoteExtraInput,\n LeasingDeliveryPackageInput,\n LeasingQuoteExtraInput,\n SalesQuoteExtraInput,\n} from './leasing-settings.js';\nimport { MatchingRuleValue } from './roi-ratings.js';\nimport { PricePercentageMode } from './utils.js';\n\nexport enum QuoteActions {\n ACCEPT = 'accept',\n VALIDATE = 'validate',\n DONWLOAD_PDFS = 'download-pdfs',\n CANCEL = 'cancel',\n}\n\nexport enum QuoteStatus {\n CREATED = 'created',\n VALIDATED = 'validated',\n INVALIDATED = 'invalidated',\n ACCEPTED = 'accepted',\n REJECTED = 'rejected',\n CANCELLED = 'cancelled',\n MANAGER_REJECTED = 'managerRejected',\n MANAGER_ACCEPTED = 'managerAccepted',\n}\n\nexport enum QuoteMetricsScore {\n DANGER = 'danger',\n NEUTRAL = 'neutral',\n GOOD = 'good',\n}\nexport enum SelfFinancingType {\n OWN_FINANCING = 'own_financing',\n ALREADY_FINANCED = 'already_financed',\n}\n\ntype BaseQuoteCalculatorInput = {\n branchId: string;\n branchCountry: string;\n customerCountry: string;\n customerVatNumber?: string;\n currency: string;\n alternativeCurrency?: string;\n exchangeRate?: string;\n vehicle: {\n id: string;\n category: string;\n bodywork?: string;\n agreedPriceExclVat: string;\n technicalNotes?: string;\n vatRate: string;\n };\n\n allRisksCost?: string;\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type LeasingCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n deliveryPackage?: LeasingQuoteExtraInput;\n settingsId: string;\n};\n\nexport type LeasingCalculatorInput = BaseQuoteCalculatorInput & {\n localLicensePlate: boolean;\n externalDelivery: boolean;\n settingsId: string;\n isRefinancingDebt?: boolean; // if true, the insurance amounts might not be the same as the leasing amount + and other costs like track and trace\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n agreedPrice: string;\n purchasePrice: string;\n };\n leasing: {\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n startupFee: string;\n startupFeeMode: PricePercentageMode;\n startupFeePercentage: string;\n /** Returnable security deposit (dépôt de garantie): VAT-free, never financed. Not the advance (`deposit`). */\n guaranteeDeposit?: string;\n interestRate: string;\n duration: number;\n contractStartDate: string;\n /** Mileage cap the contract allows per year, in km. Printed on the quote and the contract. */\n maxKmPerYear?: number;\n };\n bank: {\n interestRate: string;\n deposit: string;\n depositMode: PricePercentageMode;\n depositPercentage: string;\n residual: string;\n residualMode: PricePercentageMode;\n residualPercentage: string;\n duration: number;\n salesPrice: string;\n internalDealBranchId?: string;\n } & (\n | { selfFinancing: true; selfFinancingType?: SelfFinancingType; financing?: undefined }\n | {\n selfFinancing: false;\n selfFinancingType?: undefined;\n financing?: { bankAccountOrganizationId: string; amount: string };\n }\n );\n taxes: {\n yearlyRoadTax: boolean;\n yearlyRoadTaxCustomAmount: string;\n oneTimeRoadTax: boolean;\n margin: string; //Non Editable, copies the value insurance > margin\n };\n insurance: {\n margin: string;\n civilLiabilities: boolean;\n allRisks: boolean;\n specialTechnicalInsurance: boolean;\n roadAssistance: boolean;\n initialFractionPercentage: string;\n insuredAmount?: string;\n };\n deliveryPackage?: LeasingDeliveryPackageInput;\n extras: LeasingQuoteExtraInput[];\n customRequests: CustomLeasingQuoteExtraInput[];\n};\n\n// Sent by the Frontend to bootstrap the calculator\nexport type SalesCalculatorDefaultInput = Omit<BaseQuoteCalculatorInput, 'vehicle'> & {\n vehicle: Omit<BaseQuoteCalculatorInput['vehicle'], 'vatRate'>;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n};\n\nexport type SalesCalculatorInput = BaseQuoteCalculatorInput & {\n vehicle: BaseQuoteCalculatorInput['vehicle'] & {\n purchasePriceExclVat: string;\n premiumPrice?: string;\n minimumPrice: string;\n internetPrice?: string;\n comissionCost: string;\n };\n delivery?: SalesDeliveryType;\n extras: SalesQuoteExtraInput[];\n customRequests: CustomSalesQuoteExtraInput[];\n financing?: {\n organizationId: string;\n };\n};\n\nexport type SalesQuoteRuleInput = {\n minimumPrice?: number;\n internetPrice?: number;\n premiumPrice?: number;\n agreedPrice: number;\n stockAge: number;\n};\n\nexport type LeasingCalculatorOutput = {\n installment: string;\n installmentPrintable: string;\n totalMonthlyAmount: string;\n monthlyTaxesInsurance: string;\n beforeDeliveryExclVat: string;\n beforeDelivery: string;\n /** Portion of beforeDelivery that is the returnable guarantee deposit (VAT-free, not financed). */\n guaranteeDeposit?: string;\n financingAmount: string;\n settingId: string;\n totalRetailAmountExclVat: string;\n totalRetailAmount: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: string;\n finalSalesPrice: string;\n roi: {\n value: string;\n target: string;\n perYear: string;\n difference: string;\n score?: QuoteMetricsScore;\n };\n cashflow: {\n deficit: string;\n balanced: boolean;\n score: QuoteMetricsScore;\n };\n profitability: {\n leasing: string;\n vehicle: string;\n total: string;\n score: QuoteMetricsScore;\n };\n taxes: {\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n yearlyRoadTax: string;\n oneTimeRoadTax: string;\n profit: string;\n };\n insurance: {\n beforeDelivery: string;\n yearlyRetailPrice: string;\n monthlyRetailPrice: string;\n civilLiabilities: string;\n allRisks: string;\n specialTechnicalInsurance: string;\n roadAssistance: string;\n profit: string;\n };\n trackAndTrace: {\n beforeDelivery: string;\n monthlyCost: string;\n installationCost: string; // currently this cost is being included as part of monthlyCost. In future, this will be a separate cost\n deviceCost: string; // same as above\n profit: string;\n };\n costs: {\n financingAmount: string;\n finalCostPrice: string;\n monhtly: string;\n };\n};\n\nexport type SalesCalculatorOutput = {\n totalRetailAmount: string;\n totalRetailAmountExclVat: string;\n totalRetailAmountAlternativeCurrency?: string;\n totalRetailAmountExclVatAlternativeCurrency?: string;\n retailAmounts: {\n vehicle: string;\n delivery: string;\n extras: string;\n };\n vehicle: {\n purchasePrice: string; //incl vat\n agreedPrice: string; // incl vat\n };\n roi: { value: string; score?: QuoteMetricsScore };\n profit: {\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n profitOverMin?: {\n // deprecated\n value: string;\n percentage: string;\n score: QuoteMetricsScore;\n };\n delivery?: {\n retailPrice?: string;\n costPrice?: string;\n cleaningNeeded: boolean;\n cleaningNeededRetailPrice: string;\n transportationToPortRetailPrice?: string;\n };\n costs: {\n finalCostPrice: string;\n extras: string;\n delivery: string;\n };\n};\n\ntype BaseQuote = {\n opportunityId: string;\n preferredLanguage: string;\n clientNotes?: string;\n publicNotes?: string;\n} & (\n | {\n type: OpportunityType.LEASING;\n calculatorInput: LeasingCalculatorInput;\n calculatorOutput: LeasingCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.SALES;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type: OpportunityType.NEW_TRAILER | OpportunityType.NEW_TRAILER_NEW_PRODUCTION;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n | {\n type:\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_OUTSOURCING\n | OpportunityType.CUSTOMMADE_CONSTRUCTION_INSOURCING;\n calculatorInput: SalesCalculatorInput;\n calculatorOutput: SalesCalculatorOutput;\n rating?: MatchingRuleValue;\n }\n);\n\nexport type NewQuote = BaseQuote & {\n id?: undefined;\n createdAt?: undefined;\n createdBy?: undefined;\n modifiedAt?: undefined;\n modifiedBy?: undefined;\n active: true;\n};\n\n/**\n * A field of the linkage a quote is written against — opportunity, vehicle, contact, type and\n * branch. When one of them is edited on the deal, the deal moves to a new linkage and its\n * earlier quotes stay behind on the old one rather than following.\n */\nexport enum QuoteLinkageField {\n Vehicle = 'vehicle',\n Contact = 'contact',\n Type = 'type',\n Branch = 'branch',\n}\n\nexport type QuoteRecordMeta = {\n /**\n * The quote was computed for a linkage the deal has since left. Kept visible as history: its\n * figures were right for the vehicle, customer and branch of the day, and are not right now,\n * so the only thing left to do with it is read the PDF that was sent.\n */\n archived?: boolean;\n /** Why: the linkage fields edited on the deal since this quote was written. */\n archivedReason?: QuoteLinkageField[];\n};\n\nexport type Quote = BaseQuote & {\n id: string;\n createdAt: string;\n createdBy: string;\n modifiedAt: string;\n modifiedBy: string;\n validationBy?: string;\n validationAt?: string;\n cancelledBy?: string;\n cancelledAt?: string;\n customerFeedbackAt?: string;\n customerFeedbackBy?: string;\n managerFeedbackAt?: string;\n managerFeedbackBy?: string;\n version: number;\n status: QuoteStatus;\n proformaPdf?: AttachmentValue;\n quotePdf?: AttachmentValue;\n salesAgreementPdf?: AttachmentValue;\n active: boolean;\n contactId: string;\n vehicleId: string;\n organizationId: string;\n technicalNotesUpdated: boolean;\n technicalNotesValidated: boolean;\n technicalNotesValidatedAt?: string;\n technicalNotesValidatedBy?: string;\n externalQuote?: boolean;\n};\n\nexport type QuoteUpdate = {\n status?: QuoteStatus;\n active?: boolean;\n technicalNotesValidated?: boolean;\n};\n\nexport type CalculatorLeasingIO = {\n output: LeasingCalculatorOutput;\n input: LeasingCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorSalesIO = {\n output: SalesCalculatorOutput;\n input: SalesCalculatorInput;\n rating?: MatchingRuleValue;\n};\nexport type CalculatorQuoteIO = CalculatorLeasingIO | CalculatorSalesIO;\n\nexport type NewQuoteValidator = {\n userId: string;\n countryCode: string;\n type: OpportunityType;\n canValidateOwn?: boolean;\n};\n\nexport type QuoteValidator = NewQuoteValidator & {\n createdAt: string;\n};\n\nexport type QuoteValidatorUpdate = {\n canValidateOwn: boolean;\n};\n\nexport type {\n AddressDeliveryType,\n DeliveryLocationValue,\n DeliveryRoutesRequest,\n PickUpDeliveryType,\n PortDeliverytype,\n} from './deliveries.js';\n/** @deprecated Import delivery types from ./deliveries.js. */\nexport {\n SalesDeliveryTypes as DeliveryTypes,\n SpoilerInfo,\n TransportationMode,\n} from './deliveries.js';\n"]}
|
package/lib/types/tenants.d.ts
CHANGED
|
@@ -86,6 +86,7 @@ export type Branch = {
|
|
|
86
86
|
exactAccounting?: boolean;
|
|
87
87
|
accounting?: AccountingProvider;
|
|
88
88
|
currency: string;
|
|
89
|
+
paymentCurrencies?: [string, ...string[]];
|
|
89
90
|
adminNumberPrefix: string;
|
|
90
91
|
stockNumberPrefix: string;
|
|
91
92
|
vatNumber: string;
|
|
@@ -97,6 +98,7 @@ export type Branch = {
|
|
|
97
98
|
standard: string;
|
|
98
99
|
};
|
|
99
100
|
location: LocationValue;
|
|
101
|
+
defaultParking?: string;
|
|
100
102
|
storecoveExternalId?: number;
|
|
101
103
|
vatOnDebits?: boolean;
|
|
102
104
|
frIssuingEnabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tenants.d.ts","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD,MAAM,MAAM,YAAY,GAAG;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,CAAC,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC,CAAC;CAInC,CAAC;AAEF,oBAAY,YAAY;IACtB,cAAc,mBAAmB;IACjC,GAAG,QAAQ;IAOX,UAAU,gBAAgB;IAC1B,GAAG,QAAQ;IACX,IAAI,SAAS;IAMb,UAAU,gBAAgB;IAQ1B,WAAW,iBAAiB;IAC5B,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,yBAAyB,gCAAgC;IACzD,SAAS,cAAc;IACvB,QAAQ,aAAa;IAQrB,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;IAC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,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC","sourcesContent":["import { CognitoInfo, LocationValue, Region } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\n\nexport type PublicTenant = {\n defaultCountry: string;\n defaultCurrency: string;\n defaultLanguage: string;\n id: string; // the id is provided on creation bc we assume tenants will be created by someone on the team\n name: string;\n region: Region;\n subdomains: [string, ...string[]];\n\n // Pay attention to what information is added here since\n // the tenant can be obtained without authentication\n};\n\nexport enum TenantModule {\n Administration = 'administration',\n App = 'app',\n /**\n * The tenant's users can put the app into client mode, hiding the internal-only pages while\n * showing a screen to a customer. Left off for a tenant whose users are themselves the\n * customer: it would hide their sign-out to no purpose, and turning it back off needs a PIN\n * they were never given.\n */\n ClientMode = 'client_mode',\n CRM = 'crm',\n Docs = 'docs',\n /**\n * The app may send email on behalf of this tenant's users, e.g. sharing a vehicle: the\n * sender is the requesting user's own address, so the tenant's email domain must be one we\n * can deliver from. Absent on client tenants — we do not send mail as outsiders.\n */\n EmailShare = 'email_share',\n /**\n * The tenant's users can sign in with Google. It is a tenant fact rather than a user one:\n * `googleEmail` is only filled when the Google address differs from the BisonDesk one, and\n * every pool carries the Google provider regardless, so neither can tell who actually uses it.\n * Absent means password-only, which is what routes those users an emailed invite with a\n * genuine temporary password.\n */\n GoogleLogin = 'google_login',\n Leads = 'leads',\n Leasing = 'leasing',\n LeasingContractGeneration = 'leasing_contract_generation',\n Marketing = 'marketing',\n Insights = 'insights',\n /**\n * The tenant has agreed to exchange deal data through BisonDesk automatically, on top of the\n * bare vehicle distribution: it may be named as the buyer on an intercompany sale, which lets\n * the invoice sync and the purchase reconciliation write a purchase onto its copy. Read on the\n * BUYER only. All group tenants have it today; a supplier or client tenant that wants deal\n * data pushed too joins the exchange by being granted it.\n */\n Intercompany = 'intercompany',\n Opportunities = 'opportunities',\n Offers = 'offers',\n Vehicles = 'vehicles',\n Tasks = 'tasks',\n TrackAndTrace = 'track_and_trace',\n Bootstrap = 'bootstrap',\n WhatsappCrisp = 'whatsapp_crisp',\n /**\n * The app sends leasing clients WhatsApp messages on its own: the monthly invoice summary and\n * the overdue payment reminders (ADR-0026). Separate from `whatsapp_crisp`, which only lets\n * users send WhatsApp messages themselves. Both flows also need the tenant's Crisp settings.\n */\n WhatsappNotifications = 'whatsapp_notifications',\n Hexon = 'hexon',\n DeliveryConfirmation = 'delivery_confirmation',\n Transport = 'transport',\n Reports = 'reports',\n Prospects = 'prospects',\n}\n\n/** Report tabs a tenant can enable, in canonical order. */\nexport const REPORT_TAB_KEYS = ['sales', 'leasing', 'purchases', 'arrivals'] as const;\n\nexport type ReportTabKey = (typeof REPORT_TAB_KEYS)[number];\n\nexport type Tenant = PublicTenant & {\n cognito?: CognitoInfo;\n languages: [string, ...string[]];\n conglomerate?: string;\n emailDomain: string;\n hyperdmsIds?: string[];\n hyperportalId?: string;\n\n /* deprecated */\n exactAccounting?: boolean;\n\n branches: [Branch, ...Branch[]];\n modules: TenantModule[];\n /**\n * Reports page configuration. `tabs` lists the visible tabs in display order;\n * absent or empty means no reports are configured for the tenant (the page\n * shows a notice instead of tabs).\n */\n reports?: {\n tabs: ReportTabKey[];\n };\n test?: boolean;\n opportunities: {\n types: OpportunityType[];\n };\n /**\n * Reservation expiry for this tenant's OWN vehicles (ADR-0026): the truck's owner sets the\n * clock, wherever the deal runs — for a cross-tenant copy the chain origin's policy\n * applies, whatever opportunity type the tenant selling to the end customer uses.\n * Absent = the default\n * business-day tiers; the tier is still picked by the local customer org's\n * trustworthy/conglomerate flags.\n */\n reservationExpiry?: ReservationExpiryPolicy;\n crm?: {\n vatNumberRequiredForCompanies?: boolean;\n };\n accounting?: {\n costCenterPerLine?: boolean;\n };\n // E.164 Twilio caller ID used as a fallback when a user has no own number configured\n defaultTwilioPhoneNumber?: string;\n deliveryEmail?: string;\n /**\n * The tenant's brand. The vehicle sticker's header band takes `primary`, and so do document\n * headings when the branch letterhead sets no colour, so one layout serves every tenant. The\n * app's navigation shows the tenant name on `primary`, so users working in several tenants\n * can tell them apart. Absent = neutral grey.\n */\n brand?: {\n /** `#rrggbb` */\n primary: string;\n };\n};\n\nexport type ReservationExpiryPolicy =\n | { policy: 'disabled' }\n | { policy: 'days'; generic: number; trustworthy: number; conglomerate: number };\n\nexport type AccountingProvider = 'exact' | 'odoo';\n\nexport type Branch = {\n id: string;\n name: string;\n country: string;\n language: string;\n /* deprecated — use `accounting === 'exact'` instead. Kept until prod cutover. */\n exactAccounting?: boolean;\n accounting?: AccountingProvider;\n currency: string;\n adminNumberPrefix: string;\n stockNumberPrefix: string;\n vatNumber: string;\n contactPerson?: { firstName: string; lastName: string };\n vatRates: {\n standard: string; //percentage value (e.g. 21)\n };\n location: LocationValue;\n\n storecoveExternalId?: number;\n // true if the branch is for a company where VAT is due when the invoice\n // is issued not when the payment is collected (e.g. France, Italy, Spain)\n vatOnDebits?: boolean;\n /**\n * The French issuing duties — e-invoicing, e-reporting and the Encaissée status — are switched\n * on for this branch. Receiving is unaffected and always active.\n *\n * Kept separate from `storecoveExternalId` on purpose: registering a Storecove legal entity only\n * makes a branch reachable, it does not mean the French duties have started. As a PME those\n * duties begin 2027-09-01, so this stays off until then or until a deliberate earlier adoption.\n */\n frIssuingEnabled?: boolean;\n externalQuote?: boolean;\n hyperdmsId?: string;\n internalDealsEnabled?: boolean;\n /** The source invoices the end customer directly; this branch collects payment and earns\n * commission. Intercompany source opportunities for this branch's deals take the buyer\n * deal's own client instead of the branch counterparty org. */\n dropshipping?: boolean;\n};\n\nexport type WhatsappStateResponse = {\n enabled: boolean;\n};\n\n/**\n * What the login page is told about a tenant before anyone has signed in. Reached by subdomain\n * on the one public tenant endpoint, so it carries only what an anonymous visitor may see —\n * mind that when adding to it.\n *\n * The two booleans are answers the page cannot work out for itself: it has no session, so no\n * modules to read. They say which sign-in options to offer and whether WhatsApp sharing is on.\n */\nexport type TenantInfoResponse = {\n tenant: PublicTenant;\n whatsapp: boolean;\n googleLogin: boolean;\n cognito: CognitoInfo;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"tenants.js","sourceRoot":"/","sources":["types/tenants.ts"],"names":[],"mappings":"AAgBA,MAAM,CAAN,IAAY,YAyDX;AAzDD,WAAY,YAAY;IACtB,iDAAiC,CAAA;IACjC,2BAAW,CAAA;IAOX,0CAA0B,CAAA;IAC1B,2BAAW,CAAA;IACX,6BAAa,CAAA;IAMb,0CAA0B,CAAA;IAQ1B,4CAA4B,CAAA;IAC5B,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,yEAAyD,CAAA;IACzD,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IAQrB,6CAA6B,CAAA;IAC7B,+CAA+B,CAAA;IAC/B,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,iDAAiC,CAAA;IACjC,uCAAuB,CAAA;IACvB,gDAAgC,CAAA;IAMhC,gEAAgD,CAAA;IAChD,+BAAe,CAAA;IACf,8DAA8C,CAAA;IAC9C,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;AACzB,CAAC,EAzDW,YAAY,KAAZ,YAAY,QAyDvB;AAGD,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,CAAU,CAAC","sourcesContent":["import { CognitoInfo, LocationValue, Region } from '@bisondesk/commons-sdk/types';\nimport { OpportunityType } from '../constants.js';\n\nexport type PublicTenant = {\n defaultCountry: string;\n defaultCurrency: string;\n defaultLanguage: string;\n id: string; // the id is provided on creation bc we assume tenants will be created by someone on the team\n name: string;\n region: Region;\n subdomains: [string, ...string[]];\n\n // Pay attention to what information is added here since\n // the tenant can be obtained without authentication\n};\n\nexport enum TenantModule {\n Administration = 'administration',\n App = 'app',\n /**\n * The tenant's users can put the app into client mode, hiding the internal-only pages while\n * showing a screen to a customer. Left off for a tenant whose users are themselves the\n * customer: it would hide their sign-out to no purpose, and turning it back off needs a PIN\n * they were never given.\n */\n ClientMode = 'client_mode',\n CRM = 'crm',\n Docs = 'docs',\n /**\n * The app may send email on behalf of this tenant's users, e.g. sharing a vehicle: the\n * sender is the requesting user's own address, so the tenant's email domain must be one we\n * can deliver from. Absent on client tenants — we do not send mail as outsiders.\n */\n EmailShare = 'email_share',\n /**\n * The tenant's users can sign in with Google. It is a tenant fact rather than a user one:\n * `googleEmail` is only filled when the Google address differs from the BisonDesk one, and\n * every pool carries the Google provider regardless, so neither can tell who actually uses it.\n * Absent means password-only, which is what routes those users an emailed invite with a\n * genuine temporary password.\n */\n GoogleLogin = 'google_login',\n Leads = 'leads',\n Leasing = 'leasing',\n LeasingContractGeneration = 'leasing_contract_generation',\n Marketing = 'marketing',\n Insights = 'insights',\n /**\n * The tenant has agreed to exchange deal data through BisonDesk automatically, on top of the\n * bare vehicle distribution: it may be named as the buyer on an intercompany sale, which lets\n * the invoice sync and the purchase reconciliation write a purchase onto its copy. Read on the\n * BUYER only. All group tenants have it today; a supplier or client tenant that wants deal\n * data pushed too joins the exchange by being granted it.\n */\n Intercompany = 'intercompany',\n Opportunities = 'opportunities',\n Offers = 'offers',\n Vehicles = 'vehicles',\n Tasks = 'tasks',\n TrackAndTrace = 'track_and_trace',\n Bootstrap = 'bootstrap',\n WhatsappCrisp = 'whatsapp_crisp',\n /**\n * The app sends leasing clients WhatsApp messages on its own: the monthly invoice summary and\n * the overdue payment reminders (ADR-0026). Separate from `whatsapp_crisp`, which only lets\n * users send WhatsApp messages themselves. Both flows also need the tenant's Crisp settings.\n */\n WhatsappNotifications = 'whatsapp_notifications',\n Hexon = 'hexon',\n DeliveryConfirmation = 'delivery_confirmation',\n Transport = 'transport',\n Reports = 'reports',\n Prospects = 'prospects',\n}\n\n/** Report tabs a tenant can enable, in canonical order. */\nexport const REPORT_TAB_KEYS = ['sales', 'leasing', 'purchases', 'arrivals'] as const;\n\nexport type ReportTabKey = (typeof REPORT_TAB_KEYS)[number];\n\nexport type Tenant = PublicTenant & {\n cognito?: CognitoInfo;\n languages: [string, ...string[]];\n conglomerate?: string;\n emailDomain: string;\n hyperdmsIds?: string[];\n hyperportalId?: string;\n\n /* deprecated */\n exactAccounting?: boolean;\n\n branches: [Branch, ...Branch[]];\n modules: TenantModule[];\n /**\n * Reports page configuration. `tabs` lists the visible tabs in display order;\n * absent or empty means no reports are configured for the tenant (the page\n * shows a notice instead of tabs).\n */\n reports?: {\n tabs: ReportTabKey[];\n };\n test?: boolean;\n opportunities: {\n types: OpportunityType[];\n };\n /**\n * Reservation expiry for this tenant's OWN vehicles (ADR-0026): the truck's owner sets the\n * clock, wherever the deal runs — for a cross-tenant copy the chain origin's policy\n * applies, whatever opportunity type the tenant selling to the end customer uses.\n * Absent = the default\n * business-day tiers; the tier is still picked by the local customer org's\n * trustworthy/conglomerate flags.\n */\n reservationExpiry?: ReservationExpiryPolicy;\n crm?: {\n vatNumberRequiredForCompanies?: boolean;\n };\n accounting?: {\n costCenterPerLine?: boolean;\n };\n // E.164 Twilio caller ID used as a fallback when a user has no own number configured\n defaultTwilioPhoneNumber?: string;\n deliveryEmail?: string;\n /**\n * The tenant's brand. The vehicle sticker's header band takes `primary`, and so do document\n * headings when the branch letterhead sets no colour, so one layout serves every tenant. The\n * app's navigation shows the tenant name on `primary`, so users working in several tenants\n * can tell them apart. Absent = neutral grey.\n */\n brand?: {\n /** `#rrggbb` */\n primary: string;\n };\n};\n\nexport type ReservationExpiryPolicy =\n | { policy: 'disabled' }\n | { policy: 'days'; generic: number; trustworthy: number; conglomerate: number };\n\nexport type AccountingProvider = 'exact' | 'odoo';\n\nexport type Branch = {\n id: string;\n name: string;\n country: string;\n language: string;\n /* deprecated — use `accounting === 'exact'` instead. Kept until prod cutover. */\n exactAccounting?: boolean;\n accounting?: AccountingProvider;\n currency: string;\n /**\n * The currencies money moves in at this branch, its own `currency` included. Customer payments,\n * purchase prices, supplier invoice drafts and Exact bookings are supported in these currencies\n * only. Absent = the branch's own `currency` only. Set by script.\n */\n paymentCurrencies?: [string, ...string[]];\n adminNumberPrefix: string;\n stockNumberPrefix: string;\n vatNumber: string;\n contactPerson?: { firstName: string; lastName: string };\n vatRates: {\n standard: string; //percentage value (e.g. 21)\n };\n location: LocationValue;\n /**\n * The parking (a `location` picklist value) this branch's vehicles go to when their purchase\n * names none. Vehicle entry offers it as the stock destination, and the transport ITR prints\n * it as the park. Absent = the ITR prints the branch's own address.\n */\n defaultParking?: string;\n\n storecoveExternalId?: number;\n // true if the branch is for a company where VAT is due when the invoice\n // is issued not when the payment is collected (e.g. France, Italy, Spain)\n vatOnDebits?: boolean;\n /**\n * The French issuing duties — e-invoicing, e-reporting and the Encaissée status — are switched\n * on for this branch. Receiving is unaffected and always active.\n *\n * Kept separate from `storecoveExternalId` on purpose: registering a Storecove legal entity only\n * makes a branch reachable, it does not mean the French duties have started. As a PME those\n * duties begin 2027-09-01, so this stays off until then or until a deliberate earlier adoption.\n */\n frIssuingEnabled?: boolean;\n externalQuote?: boolean;\n hyperdmsId?: string;\n internalDealsEnabled?: boolean;\n /** The source invoices the end customer directly; this branch collects payment and earns\n * commission. Intercompany source opportunities for this branch's deals take the buyer\n * deal's own client instead of the branch counterparty org. */\n dropshipping?: boolean;\n};\n\nexport type WhatsappStateResponse = {\n enabled: boolean;\n};\n\n/**\n * What the login page is told about a tenant before anyone has signed in. Reached by subdomain\n * on the one public tenant endpoint, so it carries only what an anonymous visitor may see —\n * mind that when adding to it.\n *\n * The two booleans are answers the page cannot work out for itself: it has no session, so no\n * modules to read. They say which sign-in options to offer and whether WhatsApp sharing is on.\n */\nexport type TenantInfoResponse = {\n tenant: PublicTenant;\n whatsapp: boolean;\n googleLogin: boolean;\n cognito: CognitoInfo;\n};\n"]}
|
|
@@ -1,17 +1,24 @@
|
|
|
1
1
|
import { BaseEvent } from './internal-events.js';
|
|
2
2
|
import { SearchVehicle } from './vehicles.js';
|
|
3
3
|
export declare const VEHICLE_PURCHASE_PAYMENT_ALLOWED_NOTIFICATION_ORIGIN = "vehicle-purchase-payment-allowed-notification";
|
|
4
|
+
export type VehiclePurchasePaymentForeign = {
|
|
5
|
+
amount: string;
|
|
6
|
+
currencyCode: string;
|
|
7
|
+
exchangeRate: string;
|
|
8
|
+
};
|
|
4
9
|
export type NewVehiclePurchasePayment = {
|
|
5
10
|
vehicleId: string;
|
|
6
11
|
amount: string;
|
|
12
|
+
foreign?: Pick<VehiclePurchasePaymentForeign, 'amount' | 'currencyCode'>;
|
|
7
13
|
description?: string;
|
|
8
14
|
paidAt?: string;
|
|
9
15
|
paidBy?: string;
|
|
10
16
|
};
|
|
11
|
-
export type VehiclePurchasePayment = NewVehiclePurchasePayment & {
|
|
17
|
+
export type VehiclePurchasePayment = Omit<NewVehiclePurchasePayment, 'foreign'> & {
|
|
12
18
|
id: string;
|
|
13
19
|
createdBy: string;
|
|
14
20
|
createdAt: string;
|
|
21
|
+
foreign?: VehiclePurchasePaymentForeign;
|
|
15
22
|
};
|
|
16
23
|
export type VehiclePurchasePaymentBff = {
|
|
17
24
|
payment: VehiclePurchasePayment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vehicle-purchase-payments.d.ts","sourceRoot":"/","sources":["types/vehicle-purchase-payments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,oDAAoD,kDAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"vehicle-purchase-payments.d.ts","sourceRoot":"/","sources":["types/vehicle-purchase-payments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,eAAO,MAAM,oDAAoD,kDAChB,CAAC;AAMlD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,Y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AAe,EAAE,sBAAsB,CAAC;IACxC,MAAM,EAAE,QAAQ,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,SAAS,GACjD,CACI,iCAAiC,GACjC,iCAAiC,GACjC,iCAAiC,CACpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vehicle-purchase-payments.js","sourceRoot":"/","sources":["types/vehicle-purchase-payments.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oDAAoD,GAC/D,+CAA+C,CAAC","sourcesContent":["import { BaseEvent } from './internal-events.js';\nimport { SearchVehicle } from './vehicles.js';\n\nexport const VEHICLE_PURCHASE_PAYMENT_ALLOWED_NOTIFICATION_ORIGIN =\n 'vehicle-purchase-payment-allowed-notification';\n\nexport type NewVehiclePurchasePayment = {\n vehicleId: string;\n amount: string;\n description?: string;\n paidAt?: string;\n paidBy?: string;\n};\n\nexport type VehiclePurchasePayment = NewVehiclePurchasePayment & {\n id: string;\n createdBy: string;\n createdAt: string;\n};\n\nexport type VehiclePurchasePaymentBff = {\n payment: VehiclePurchasePayment;\n vehicle: SearchVehicle;\n};\n\nexport type VehiclePurchasePaymentCreateEvent = {\n payment: VehiclePurchasePayment;\n previousPayment?: undefined;\n action: 'create';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type VehiclePurchasePaymentUpdateEvent = {\n payment: VehiclePurchasePayment;\n previousPayment: VehiclePurchasePayment;\n action: 'update';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type VehiclePurchasePaymentDeleteEvent = {\n payment?: undefined;\n previousPayment: VehiclePurchasePayment;\n action: 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type VehiclePurchasePaymentEvent = BaseEvent &\n (\n | VehiclePurchasePaymentCreateEvent\n | VehiclePurchasePaymentUpdateEvent\n | VehiclePurchasePaymentDeleteEvent\n );\n"]}
|
|
1
|
+
{"version":3,"file":"vehicle-purchase-payments.js","sourceRoot":"/","sources":["types/vehicle-purchase-payments.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,oDAAoD,GAC/D,+CAA+C,CAAC","sourcesContent":["import { BaseEvent } from './internal-events.js';\nimport { SearchVehicle } from './vehicles.js';\n\nexport const VEHICLE_PURCHASE_PAYMENT_ALLOWED_NOTIFICATION_ORIGIN =\n 'vehicle-purchase-payment-allowed-notification';\n\n/**\n * A payment on a purchase priced in another currency is authorized and paid in that currency.\n * `amount` then holds its value in branch currency: `foreign.amount × foreign.exchangeRate`.\n */\nexport type VehiclePurchasePaymentForeign = {\n amount: string;\n currencyCode: string;\n /** Branch currency units per 1 unit of `currencyCode`, the purchase's rate. */\n exchangeRate: string;\n};\n\nexport type NewVehiclePurchasePayment = {\n vehicleId: string;\n /** Branch currency. Derived from `foreign` when the purchase is priced in another currency. */\n amount: string;\n /** The backend takes the rate from the purchase. */\n foreign?: Pick<VehiclePurchasePaymentForeign, 'amount' | 'currencyCode'>;\n description?: string;\n paidAt?: string;\n paidBy?: string;\n};\n\nexport type VehiclePurchasePayment = Omit<NewVehiclePurchasePayment, 'foreign'> & {\n id: string;\n createdBy: string;\n createdAt: string;\n foreign?: VehiclePurchasePaymentForeign;\n};\n\nexport type VehiclePurchasePaymentBff = {\n payment: VehiclePurchasePayment;\n vehicle: SearchVehicle;\n};\n\nexport type VehiclePurchasePaymentCreateEvent = {\n payment: VehiclePurchasePayment;\n previousPayment?: undefined;\n action: 'create';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type VehiclePurchasePaymentUpdateEvent = {\n payment: VehiclePurchasePayment;\n previousPayment: VehiclePurchasePayment;\n action: 'update';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type VehiclePurchasePaymentDeleteEvent = {\n payment?: undefined;\n previousPayment: VehiclePurchasePayment;\n action: 'delete';\n actionAt: string;\n userId: string;\n tenantId: string;\n};\n\nexport type VehiclePurchasePaymentEvent = BaseEvent &\n (\n | VehiclePurchasePaymentCreateEvent\n | VehiclePurchasePaymentUpdateEvent\n | VehiclePurchasePaymentDeleteEvent\n );\n"]}
|
package/lib/types/vehicles.d.ts
CHANGED
|
@@ -150,6 +150,7 @@ export type NewVehicleRequest = {
|
|
|
150
150
|
dealStatus: VehiclePurchaseDealStatus;
|
|
151
151
|
costs: {
|
|
152
152
|
purchase: string;
|
|
153
|
+
foreign?: VehiclePurchaseDealForeign;
|
|
153
154
|
purchaseVatPercentage: string;
|
|
154
155
|
commission?: string;
|
|
155
156
|
externalTransport?: string;
|
|
@@ -684,6 +685,11 @@ export type VehiclePriceUpdateResponse = {
|
|
|
684
685
|
success: false;
|
|
685
686
|
errors: VehiclePriceUpdateError[];
|
|
686
687
|
};
|
|
688
|
+
export type VehiclePurchaseDealForeign = {
|
|
689
|
+
purchase: string;
|
|
690
|
+
currencyCode: string;
|
|
691
|
+
exchangeRate: string;
|
|
692
|
+
};
|
|
687
693
|
export type VehiclePurchase = {
|
|
688
694
|
organizationId: string;
|
|
689
695
|
contactId: string;
|
|
@@ -715,6 +721,7 @@ export type VehiclePurchase = {
|
|
|
715
721
|
readyToDeliver?: boolean;
|
|
716
722
|
purchaseVatRate?: string;
|
|
717
723
|
purchase?: string;
|
|
724
|
+
foreign?: VehiclePurchaseDealForeign;
|
|
718
725
|
bonus?: string;
|
|
719
726
|
commission?: string;
|
|
720
727
|
externalTransport?: string;
|