@bisondesk/core-sdk 1.0.650 → 1.0.651
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.
|
@@ -14,8 +14,9 @@ export declare enum TransportStatus {
|
|
|
14
14
|
Todo = "TODO",
|
|
15
15
|
Planning = "PLANNING",
|
|
16
16
|
Ready = "READY",
|
|
17
|
+
ScheduledExternal = "SCHEDULED_EXTERNAL",
|
|
17
18
|
OngoingInternal = "ONGOING_INTERNAL",
|
|
18
|
-
|
|
19
|
+
OngoingShip = "ONGOING_SHIP",
|
|
19
20
|
Done = "DONE"
|
|
20
21
|
}
|
|
21
22
|
export declare const TransportStatusOrder: TransportStatus[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports.d.ts","sourceRoot":"/","sources":["types/transports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACjF,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEzD,oBAAY,aAAa;IACvB,cAAc,qBAAqB;IACnC,YAAY,kBAAkB;CAC/B;AAED,oBAAY,eAAe;IACzB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,
|
|
1
|
+
{"version":3,"file":"transports.d.ts","sour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-9,16 +9,18 @@ export var TransportStatus;
|
|
|
9
9
|
TransportStatus["Todo"] = "TODO";
|
|
10
10
|
TransportStatus["Planning"] = "PLANNING";
|
|
11
11
|
TransportStatus["Ready"] = "READY";
|
|
12
|
+
TransportStatus["ScheduledExternal"] = "SCHEDULED_EXTERNAL";
|
|
12
13
|
TransportStatus["OngoingInternal"] = "ONGOING_INTERNAL";
|
|
13
|
-
TransportStatus["
|
|
14
|
+
TransportStatus["OngoingShip"] = "ONGOING_SHIP";
|
|
14
15
|
TransportStatus["Done"] = "DONE";
|
|
15
16
|
})(TransportStatus || (TransportStatus = {}));
|
|
16
17
|
export const TransportStatusOrder = [
|
|
17
18
|
TransportStatus.Todo,
|
|
18
19
|
TransportStatus.Planning,
|
|
19
20
|
TransportStatus.Ready,
|
|
21
|
+
TransportStatus.ScheduledExternal,
|
|
20
22
|
TransportStatus.OngoingInternal,
|
|
21
|
-
TransportStatus.
|
|
23
|
+
TransportStatus.OngoingShip,
|
|
22
24
|
];
|
|
23
25
|
export const TransportDoneColumnId = TransportStatus.Done;
|
|
24
26
|
export const TransportKanbanEndColumns = [TransportDoneColumnId];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transports.js","sourceRoot":"/","sources":["types/transports.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,aAAa,GAGd,MAAM,aAAa,CAAC;AAKrB,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,oDAAmC,CAAA;IACnC,+CAA8B,CAAA;AAChC,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB;AAED,MAAM,CAAN,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,wCAAqB,CAAA;IACrB,kCAAe,CAAA;IACf,uDAAoC,CAAA;IACpC,uDAAoC,CAAA;IACpC,gCAAa,CAAA;AACf,CAAC,EAPW,eAAe,KAAf,eAAe,QAO1B;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAsB;IACrD,e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ANW,sBAAsB,KAAtB,sBAAsB,QAMjC;AAcD,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,+DAAoC,CAAA;IACpC,qDAA0B,CAAA;IAC1B,qDAA0B,CAAA;AAC5B,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC","sourcesContent":["import { GPSCoord, NextList, PaginatedList } from '@bisondesk/commons-sdk/types';\nimport { Organization } from './crm.js';\nimport { BaseEvent } from './internal-events.js';\nimport { Opportunity, OpportunityPaymentStatus } from './opportunities.js';\nimport {\n AddressDeliveryType,\n DeliveryTypes,\n PickUpDeliveryType,\n PortDeliverytype,\n} from './quotes.js';\nimport { BaseSearchRequest, SortOrder } from './search.js';\nimport { DataRecord, ReferenceData } from './utils.js';\nimport { Vehicle, VehiclePurchase } from './vehicles.js';\n\nexport enum TransportType {\n PurchasePickUp = 'PURCHASE_PICK_UP',\n SaleDelivery = 'SALE_DELIVERY',\n}\n\nexport enum TransportStatus {\n Todo = 'TODO',\n Planning = 'PLANNING',\n Ready = 'READY',\n OngoingInternal = 'ONGOING_INTERNAL',\n OngoingExternal = 'ONGOING_EXTERNAL',\n Done = 'DONE',\n}\n\nexport const TransportStatusOrder: TransportStatus[] = [\n TransportStatus.Todo,\n TransportStatus.Planning,\n TransportStatus.Ready,\n TransportStatus.OngoingInternal,\n TransportStatus.OngoingExternal,\n];\n\nexport const TransportDoneColumnId = TransportStatus.Done;\n\nexport const TransportKanbanEndColumns: TransportStatus[] = [TransportDoneColumnId];\nexport const TransportKanbanColumns: TransportStatus[] = [\n ...TransportStatusOrder,\n ...TransportKanbanEndColumns,\n];\n\nexport enum TransportPriority {\n Normal = 'NORMAL',\n High = 'HIGH',\n Urgent = 'URGENT',\n}\n\nexport const TransportSalesDeliveryType = {\n Address: DeliveryTypes.ADDRESS,\n Port: DeliveryTypes.PORT,\n PortAndShip: DeliveryTypes.PORT_AND_SHIP,\n PickUp: DeliveryTypes.PICK_UP,\n} as const;\n\n/**\n * The customer collects the vehicle. Nothing is driven anywhere, but the papers still have to be\n * arranged and paid for — transit plates, technical control, insurance — which is why it is a\n * delivery type administration reviews rather than the absence of one.\n *\n * `dateOfPickUpByCustomer` is dropped from the quote's shape: the transport's own `date` is the\n * collection day, and two fields for one date only ever disagree.\n */\nexport type TransportPickUpDeliveryType = Omit<PickUpDeliveryType, 'dateOfPickUpByCustomer'>;\n\nexport type TransportSalesDeliveryType = (\n | PortDeliverytype\n | AddressDeliveryType\n | TransportPickUpDeliveryType\n) & {\n cleaningNeeded?: boolean;\n driver?: string;\n transportCompany?: string;\n date?: string; // Pick-up (purchase) | Delivery (OPP) (leaves parking)\n adminCost?: string; // user-entered administrative cost summed into totalCostExclVat\n stackingVehicleCostPrice?: string; // overrides the stacking rate from the delivery settings\n};\n\nexport type TransportPurchaseDeliveryType = AddressDeliveryType & {\n cleaningNeeded?: boolean;\n driver?: string;\n transportCompany?: string;\n date?: string; // Pick-up (purchase) | Delivery (OPP) (leaves parking)\n adminCost?: string; // user-entered administrative cost summed into totalCostExclVat\n stackingVehicleCostPrice?: string; // overrides the stacking rate from the delivery settings\n};\n\nexport type Transport = {\n id: string;\n vehicleId: string;\n opportunityId?: string;\n\n status: TransportStatus;\n priority: TransportPriority;\n\n // administrative fields\n adminApproved: boolean;\n adminApprovedAt?: string;\n adminApprovedBy?: string;\n transportWithoutPayment?: boolean;\n notes?: string;\n\n totals: {\n totalRetailAmountExclVat: string;\n totalCostExclVat: string;\n estimatedTotalCostExclVat?: string;\n };\n\n log: Array<{\n status: TransportStatus;\n completedAt: string;\n completedBy: string;\n }>;\n\n doneAt?: string;\n doneBy?: string;\n canceledAt?: string;\n canceledBy?: string;\n\n createdAt: string;\n createdBy: string;\n updatedAt: string;\n updatedBy: string;\n} & (\n | {\n type: TransportType.PurchasePickUp;\n delivery: TransportPurchaseDeliveryType;\n }\n | {\n type: TransportType.SaleDelivery;\n delivery: TransportSalesDeliveryType;\n }\n);\n\nexport enum TransportWarningCode {\n PurchaseLogisticsNotReady = 'purchase_logistics_not_ready',\n}\n\nexport type TransportWarning = {\n code: TransportWarningCode;\n details?: Record<string, string | number | boolean>;\n};\n\nexport type TransportCost = Pick<Transport, 'totals'>;\n\nexport type TransportRecord = DataRecord<Transport>;\n\n/**\n * What a requester may change on a transport, field group by field group. The server filters an\n * update through these and returns the ones granted on the record, so the drawer disables what the\n * user cannot touch instead of deciding for itself from the user's roles.\n */\nexport enum TransportActions {\n /** The route: addresses, ports, dates, costs. */\n SetDelivery = 'set_delivery',\n SetNotes = 'set_notes',\n /** The administrative sign-off, and the clearance to move before the payment. */\n SetApproval = 'set_approval',\n /** The board column. */\n SetStatus = 'set_status',\n SetPriority = 'set_priority',\n SetBookingRef = 'set_booking_ref',\n}\n\n/**\n * Every field a write may set, in one shape. `delivery` is replaced whole when it is sent — there is\n * no partial merge into the stored one — which is why `bookingRef` rides alongside as a scalar the\n * server writes into the delivery it ends up with.\n */\nexport type TransportUpdate = {\n delivery?: TransportSalesDeliveryType | TransportPurchaseDeliveryType;\n notes?: string | null;\n adminApproved?: boolean;\n transportWithoutPayment?: boolean;\n status?: TransportStatus;\n priority?: TransportPriority;\n bookingRef?: string | null;\n};\n\ntype BaseTransportEvent = {\n actionAt: string;\n userId: string;\n tenantId: string;\n transportId: string;\n};\n\nexport type TransportCreateEvent = BaseTransportEvent & {\n action: 'create';\n data: Transport;\n previousData?: undefined;\n};\n\nexport type TransportUpdateEvent = BaseTransportEvent & {\n action: 'update';\n data: Transport;\n previousData: Transport;\n};\n\n/** Published whenever a transport is written. Carries both sides so subscribers judge relevance. */\nexport type TransportEvent = BaseEvent & (TransportCreateEvent | TransportUpdateEvent);\n\nexport enum TransportPaymentStatus {\n NoPayment = 'no_payment',\n PartialPaymentReceived = 'partial_payment_received',\n FullPaymentReceived = 'full_payment_received',\n PartialPaymentSent = 'partial_payment_sent',\n FullPaymentSent = 'full_payment_sent',\n}\n\n/**\n * Where the money stands on the record the transport serves: the customer's payments on the\n * opportunity for a sale delivery, ours to the supplier for a purchase pick-up. Denormalised at\n * indexing time so the board can show it without joining.\n */\nexport type TransportPayment = {\n status: OpportunityPaymentStatus;\n /** Only a sale delivery knows the ratio — a pick-up has milestones, not a running total. */\n percentagePaid?: string;\n};\n\n/** Which address the map pin came from, so the UI can tell an exact pin from an approximate one. */\nexport enum TransportLocationSource {\n DeliveryAddress = 'delivery_address',\n OriginPort = 'origin_port',\n OrgAddress = 'org_address',\n}\n\nexport type SearchTransport = {\n transport: Transport;\n vehicle: Vehicle;\n org: Organization;\n opportunity?: Opportunity;\n purchase: VehiclePurchase;\n tasks: {\n totalTasks: number;\n openTasks: number;\n nextDueAt?: string;\n };\n custom: {\n commercialUserIds: string[];\n warnings: TransportWarning[];\n priorityOrdinal: number;\n payment: TransportPayment;\n paymentStatus: TransportPaymentStatus;\n /**\n * Where the transport happens: the delivery address, or the origin port for a shipped delivery.\n * Denormalised into one field because the map clusters over a single geo_point, and a port\n * delivery carries no address of its own.\n *\n * Deliberately narrower than `GPSCoord`: a geo_point field rejects any key beyond lat/lon, so\n * the map zoom the coordinates picker stores must not reach the index.\n */\n location?: Pick<GPSCoord, 'lat' | 'lon'>;\n locationSource?: TransportLocationSource;\n };\n};\n\nexport type SearchTransportList = PaginatedList<SearchTransport, ReferenceData>;\n\nexport type TransportKanbanColumn = {\n status: TransportStatus;\n results: SearchTransport[];\n totalCount: number;\n};\n\nexport type MSearchTransportsKanbanColumn = {\n column: TransportKanbanColumn;\n nextToken?: string;\n};\n\nexport type KanbanTransportsSearchRequest = BaseSearchRequest & {\n nextTokens?: Record<string, string | undefined>;\n statusSortBy?: Record<TransportStatus, { fieldId: string; order: SortOrder }[]>;\n};\n\nexport type KanbanTransportsNextList = Omit<\n NextList<TransportKanbanColumn, ReferenceData>,\n 'nextToken'\n> & {\n nextTokens?: Record<string, string | undefined>;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"transports.js","sourceRoot":"/","sources":["types/transports.ts"],"names":[],"mappings":"AAIA,OA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;IAC9B,kFAA0D,CAAA;AAC5D,CAAC,EAFW,oBAAoB,KAApB,oBAAoB,QAE/B;AAgBD,MAAM,CAAN,IAAY,gBAUX;AAVD,WAAY,gBAAgB;IAE1B,gDAA4B,CAAA;IAC5B,0CAAsB,CAAA;IAEtB,gDAA4B,CAAA;IAE5B,4CAAwB,CAAA;IACxB,gDAA4B,CAAA;IAC5B,qDAAiC,CAAA;AACnC,CAAC,EAVW,gBAAgB,KAAhB,gBAAgB,QAU3B;AAuCD,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,kDAAwB,CAAA;IACxB,6EAAmD,CAAA;IACnD,uEAA6C,CAAA;IAC7C,qEAA2C,CAAA;IAC3C,+DAAqC,CAAA;AACvC,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC;AAcD,MAAM,CAAN,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IACjC,+DAAoC,CAAA;IACpC,qDAA0B,CAAA;IAC1B,qDAA0B,CAAA;AAC5B,CAAC,EAJW,uBAAuB,KAAvB,uBAAuB,QAIlC","sourcesContent":["import { GPSCoord, NextList, PaginatedList } from '@bisondesk/commons-sdk/types';\nimport { Organization } from './crm.js';\nimport { BaseEvent } from './internal-events.js';\nimport { Opportunity, OpportunityPaymentStatus } from './opportunities.js';\nimport {\n AddressDeliveryType,\n DeliveryTypes,\n PickUpDeliveryType,\n PortDeliverytype,\n} from './quotes.js';\nimport { BaseSearchRequest, SortOrder } from './search.js';\nimport { DataRecord, ReferenceData } from './utils.js';\nimport { Vehicle, VehiclePurchase } from './vehicles.js';\n\nexport enum TransportType {\n PurchasePickUp = 'PURCHASE_PICK_UP',\n SaleDelivery = 'SALE_DELIVERY',\n}\n\nexport enum TransportStatus {\n Todo = 'TODO',\n Planning = 'PLANNING',\n Ready = 'READY',\n ScheduledExternal = 'SCHEDULED_EXTERNAL',\n OngoingInternal = 'ONGOING_INTERNAL',\n OngoingShip = 'ONGOING_SHIP',\n Done = 'DONE',\n}\n\nexport const TransportStatusOrder: TransportStatus[] = [\n TransportStatus.Todo,\n TransportStatus.Planning,\n TransportStatus.Ready,\n TransportStatus.ScheduledExternal,\n TransportStatus.OngoingInternal,\n TransportStatus.OngoingShip,\n];\n\nexport const TransportDoneColumnId = TransportStatus.Done;\n\nexport const TransportKanbanEndColumns: TransportStatus[] = [TransportDoneColumnId];\nexport const TransportKanbanColumns: TransportStatus[] = [\n ...TransportStatusOrder,\n ...TransportKanbanEndColumns,\n];\n\nexport enum TransportPriority {\n Normal = 'NORMAL',\n High = 'HIGH',\n Urgent = 'URGENT',\n}\n\nexport const TransportSalesDeliveryType = {\n Address: DeliveryTypes.ADDRESS,\n Port: DeliveryTypes.PORT,\n PortAndShip: DeliveryTypes.PORT_AND_SHIP,\n PickUp: DeliveryTypes.PICK_UP,\n} as const;\n\n/**\n * The customer collects the vehicle. Nothing is driven anywhere, but the papers still have to be\n * arranged and paid for — transit plates, technical control, insurance — which is why it is a\n * delivery type administration reviews rather than the absence of one.\n *\n * `dateOfPickUpByCustomer` is dropped from the quote's shape: the transport's own `date` is the\n * collection day, and two fields for one date only ever disagree.\n */\nexport type TransportPickUpDeliveryType = Omit<PickUpDeliveryType, 'dateOfPickUpByCustomer'>;\n\nexport type TransportSalesDeliveryType = (\n | PortDeliverytype\n | AddressDeliveryType\n | TransportPickUpDeliveryType\n) & {\n cleaningNeeded?: boolean;\n driver?: string;\n transportCompany?: string;\n date?: string; // Pick-up (purchase) | Delivery (OPP) (leaves parking)\n adminCost?: string; // user-entered administrative cost summed into totalCostExclVat\n stackingVehicleCostPrice?: string; // overrides the stacking rate from the delivery settings\n};\n\nexport type TransportPurchaseDeliveryType = AddressDeliveryType & {\n cleaningNeeded?: boolean;\n driver?: string;\n transportCompany?: string;\n date?: string; // Pick-up (purchase) | Delivery (OPP) (leaves parking)\n adminCost?: string; // user-entered administrative cost summed into totalCostExclVat\n stackingVehicleCostPrice?: string; // overrides the stacking rate from the delivery settings\n};\n\nexport type Transport = {\n id: string;\n vehicleId: string;\n opportunityId?: string;\n\n status: TransportStatus;\n priority: TransportPriority;\n\n // administrative fields\n adminApproved: boolean;\n adminApprovedAt?: string;\n adminApprovedBy?: string;\n transportWithoutPayment?: boolean;\n notes?: string;\n\n totals: {\n totalRetailAmountExclVat: string;\n totalCostExclVat: string;\n estimatedTotalCostExclVat?: string;\n };\n\n log: Array<{\n status: TransportStatus;\n completedAt: string;\n completedBy: string;\n }>;\n\n doneAt?: string;\n doneBy?: string;\n canceledAt?: string;\n canceledBy?: string;\n\n createdAt: string;\n createdBy: string;\n updatedAt: string;\n updatedBy: string;\n} & (\n | {\n type: TransportType.PurchasePickUp;\n delivery: TransportPurchaseDeliveryType;\n }\n | {\n type: TransportType.SaleDelivery;\n delivery: TransportSalesDeliveryType;\n }\n);\n\nexport enum TransportWarningCode {\n PurchaseLogisticsNotReady = 'purchase_logistics_not_ready',\n}\n\nexport type TransportWarning = {\n code: TransportWarningCode;\n details?: Record<string, string | number | boolean>;\n};\n\nexport type TransportCost = Pick<Transport, 'totals'>;\n\nexport type TransportRecord = DataRecord<Transport>;\n\n/**\n * What a requester may change on a transport, field group by field group. The server filters an\n * update through these and returns the ones granted on the record, so the drawer disables what the\n * user cannot touch instead of deciding for itself from the user's roles.\n */\nexport enum TransportActions {\n /** The route: addresses, ports, dates, costs. */\n SetDelivery = 'set_delivery',\n SetNotes = 'set_notes',\n /** The administrative sign-off, and the clearance to move before the payment. */\n SetApproval = 'set_approval',\n /** The board column. */\n SetStatus = 'set_status',\n SetPriority = 'set_priority',\n SetBookingRef = 'set_booking_ref',\n}\n\n/**\n * Every field a write may set, in one shape. `delivery` is replaced whole when it is sent — there is\n * no partial merge into the stored one — which is why `bookingRef` rides alongside as a scalar the\n * server writes into the delivery it ends up with.\n */\nexport type TransportUpdate = {\n delivery?: TransportSalesDeliveryType | TransportPurchaseDeliveryType;\n notes?: string | null;\n adminApproved?: boolean;\n transportWithoutPayment?: boolean;\n status?: TransportStatus;\n priority?: TransportPriority;\n bookingRef?: string | null;\n};\n\ntype BaseTransportEvent = {\n actionAt: string;\n userId: string;\n tenantId: string;\n transportId: string;\n};\n\nexport type TransportCreateEvent = BaseTransportEvent & {\n action: 'create';\n data: Transport;\n previousData?: undefined;\n};\n\nexport type TransportUpdateEvent = BaseTransportEvent & {\n action: 'update';\n data: Transport;\n previousData: Transport;\n};\n\n/** Published whenever a transport is written. Carries both sides so subscribers judge relevance. */\nexport type TransportEvent = BaseEvent & (TransportCreateEvent | TransportUpdateEvent);\n\nexport enum TransportPaymentStatus {\n NoPayment = 'no_payment',\n PartialPaymentReceived = 'partial_payment_received',\n FullPaymentReceived = 'full_payment_received',\n PartialPaymentSent = 'partial_payment_sent',\n FullPaymentSent = 'full_payment_sent',\n}\n\n/**\n * Where the money stands on the record the transport serves: the customer's payments on the\n * opportunity for a sale delivery, ours to the supplier for a purchase pick-up. Denormalised at\n * indexing time so the board can show it without joining.\n */\nexport type TransportPayment = {\n status: OpportunityPaymentStatus;\n /** Only a sale delivery knows the ratio — a pick-up has milestones, not a running total. */\n percentagePaid?: string;\n};\n\n/** Which address the map pin came from, so the UI can tell an exact pin from an approximate one. */\nexport enum TransportLocationSource {\n DeliveryAddress = 'delivery_address',\n OriginPort = 'origin_port',\n OrgAddress = 'org_address',\n}\n\nexport type SearchTransport = {\n transport: Transport;\n vehicle: Vehicle;\n org: Organization;\n opportunity?: Opportunity;\n purchase: VehiclePurchase;\n tasks: {\n totalTasks: number;\n openTasks: number;\n nextDueAt?: string;\n };\n custom: {\n commercialUserIds: string[];\n warnings: TransportWarning[];\n priorityOrdinal: number;\n payment: TransportPayment;\n paymentStatus: TransportPaymentStatus;\n /**\n * Where the transport happens: the delivery address, or the origin port for a shipped delivery.\n * Denormalised into one field because the map clusters over a single geo_point, and a port\n * delivery carries no address of its own.\n *\n * Deliberately narrower than `GPSCoord`: a geo_point field rejects any key beyond lat/lon, so\n * the map zoom the coordinates picker stores must not reach the index.\n */\n location?: Pick<GPSCoord, 'lat' | 'lon'>;\n locationSource?: TransportLocationSource;\n };\n};\n\nexport type SearchTransportList = PaginatedList<SearchTransport, ReferenceData>;\n\nexport type TransportKanbanColumn = {\n status: TransportStatus;\n results: SearchTransport[];\n totalCount: number;\n};\n\nexport type MSearchTransportsKanbanColumn = {\n column: TransportKanbanColumn;\n nextToken?: string;\n};\n\nexport type KanbanTransportsSearchRequest = BaseSearchRequest & {\n nextTokens?: Record<string, string | undefined>;\n statusSortBy?: Record<TransportStatus, { fieldId: string; order: SortOrder }[]>;\n};\n\nexport type KanbanTransportsNextList = Omit<\n NextList<TransportKanbanColumn, ReferenceData>,\n 'nextToken'\n> & {\n nextTokens?: Record<string, string | undefined>;\n};\n"]}
|
package/package.json
CHANGED
package/src/types/transports.ts
CHANGED
|
@@ -21,8 +21,9 @@ export enum TransportStatus {
|
|
|
21
21
|
Todo = 'TODO',
|
|
22
22
|
Planning = 'PLANNING',
|
|
23
23
|
Ready = 'READY',
|
|
24
|
+
ScheduledExternal = 'SCHEDULED_EXTERNAL',
|
|
24
25
|
OngoingInternal = 'ONGOING_INTERNAL',
|
|
25
|
-
|
|
26
|
+
OngoingShip = 'ONGOING_SHIP',
|
|
26
27
|
Done = 'DONE',
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -30,8 +31,9 @@ export const TransportStatusOrder: TransportStatus[] = [
|
|
|
30
31
|
TransportStatus.Todo,
|
|
31
32
|
TransportStatus.Planning,
|
|
32
33
|
TransportStatus.Ready,
|
|
34
|
+
TransportStatus.ScheduledExternal,
|
|
33
35
|
TransportStatus.OngoingInternal,
|
|
34
|
-
TransportStatus.
|
|
36
|
+
TransportStatus.OngoingShip,
|
|
35
37
|
];
|
|
36
38
|
|
|
37
39
|
export const TransportDoneColumnId = TransportStatus.Done;
|