diff --git a/appointment.ts b/appointment.ts index e62931d..2fe9ea7 100644 --- a/appointment.ts +++ b/appointment.ts @@ -15,7 +15,7 @@ import { Slot } from "./slotbooking"; import { CarrierInformationWithValue } from "./slotbooking"; import { Segmentation } from "./slotbooking"; import { QuantityByUnit } from "./slotbooking"; -import { Commission } from "./collabShared"; +import { Commission } from "./slotbooking"; import { AppointmentType } from "./slotbooking"; import { EntityID } from "./shared"; import { EventHeader } from "./shared"; diff --git a/appointmentInput.ts b/appointmentInput.ts index 29d1aa8..ed10384 100644 --- a/appointmentInput.ts +++ b/appointmentInput.ts @@ -19,7 +19,7 @@ import { Slot } from "./slotbooking"; import { CarrierInformationWithValue } from "./slotbooking"; import { Segmentation } from "./slotbooking"; import { QuantityByUnit } from "./slotbooking"; -import { Commission } from "./collabShared"; +import { Commission } from "./slotbooking"; import { AppointmentType } from "./slotbooking"; // // Created : this message tells that appointment is created diff --git a/collabShared.ts b/collabShared.ts index 83cdcc6..7b570f5 100644 --- a/collabShared.ts +++ b/collabShared.ts @@ -10,7 +10,6 @@ import { UnknownFieldHandler } from "@protobuf-ts/runtime"; import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; -import { QuantityByUnit } from "./slotbooking"; import { Struct } from "./google/protobuf/struct"; import { DateTime } from "./shared"; import { ClaimStatus } from "./shared"; @@ -197,29 +196,6 @@ export interface AppointmentStatusStruct { */ Version: number; } -/** - * @generated from protobuf message api.Commission - */ -export interface Commission { - /** - * Identifier for the project associated with the order - * - * @generated from protobuf field: string ProjectID = 1 - */ - ProjectID: string; - /** - * ID of the order, might be null for standalone - * - * @generated from protobuf field: string OrderID = 2 - */ - OrderID: string; - /** - * Volumetry inside the truck, should have at least one item listed - * - * @generated from protobuf field: repeated api.QuantityByUnit Quantities = 3 - */ - Quantities: QuantityByUnit[]; -} /** * @generated from protobuf enum api.NotifTypeEnum */ @@ -863,66 +839,3 @@ class AppointmentStatusStruct$Type extends MessageType * @generated MessageType for protobuf message api.AppointmentStatusStruct */ export const AppointmentStatusStruct = new AppointmentStatusStruct$Type(); -// @generated message type with reflection information, may provide speed optimized methods -class Commission$Type extends MessageType { - constructor() { - super("api.Commission", [ - { no: 1, name: "ProjectID", kind: "scalar", localName: "ProjectID", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, - { no: 2, name: "OrderID", kind: "scalar", localName: "OrderID", jsonName: "OrderID", T: 9 /*ScalarType.STRING*/ }, - { no: 3, name: "Quantities", kind: "message", localName: "Quantities", jsonName: "Quantities", repeat: 2 /*RepeatType.UNPACKED*/, T: () => QuantityByUnit, options: { "validate.rules": { repeated: { minItems: "1" } } } } - ]); - } - create(value?: PartialMessage): Commission { - const message = globalThis.Object.create((this.messagePrototype!)); - message.ProjectID = ""; - message.OrderID = ""; - message.Quantities = []; - if (value !== undefined) - reflectionMergePartial(this, message, value); - return message; - } - internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Commission): Commission { - let message = target ?? this.create(), end = reader.pos + length; - while (reader.pos < end) { - let [fieldNo, wireType] = reader.tag(); - switch (fieldNo) { - case /* string ProjectID */ 1: - message.ProjectID = reader.string(); - break; - case /* string OrderID */ 2: - message.OrderID = reader.string(); - break; - case /* repeated api.QuantityByUnit Quantities */ 3: - message.Quantities.push(QuantityByUnit.internalBinaryRead(reader, reader.uint32(), options)); - break; - default: - let u = options.readUnknownField; - if (u === "throw") - throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); - let d = reader.skip(wireType); - if (u !== false) - (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); - } - } - return message; - } - internalBinaryWrite(message: Commission, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { - /* string ProjectID = 1; */ - if (message.ProjectID !== "") - writer.tag(1, WireType.LengthDelimited).string(message.ProjectID); - /* string OrderID = 2; */ - if (message.OrderID !== "") - writer.tag(2, WireType.LengthDelimited).string(message.OrderID); - /* repeated api.QuantityByUnit Quantities = 3; */ - for (let i = 0; i < message.Quantities.length; i++) - QuantityByUnit.internalBinaryWrite(message.Quantities[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); - let u = options.writeUnknownFields; - if (u !== false) - (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); - return writer; - } -} -/** - * @generated MessageType for protobuf message api.Commission - */ -export const Commission = new Commission$Type(); diff --git a/package.json b/package.json index 8cab06b..fa62988 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@reflex-platform/npm-core-sdk", - "version": "1.11.0-SNAPSHOT-250526122642", + "version": "1.11.0-SNAPSHOT-250526135811", "description": "npm libs from core model proto files", "homepage": "", "main": "index.ts", diff --git a/site.ts b/site.ts index e929172..258719d 100644 --- a/site.ts +++ b/site.ts @@ -12,7 +12,8 @@ import type { PartialMessage } from "@protobuf-ts/runtime"; import { reflectionMergePartial } from "@protobuf-ts/runtime"; import { MessageType } from "@protobuf-ts/runtime"; import { Slot } from "./slotbooking"; -import { Commission } from "./collabShared"; +import { SlotGroup } from "./slotbooking"; +import { Commission } from "./slotbooking"; import { AppointmentType } from "./slotbooking"; import { RequestSiteHeader } from "./shared"; import { RequestOrganisationHeader } from "./shared"; @@ -437,9 +438,9 @@ export interface GetAvailableSlotsRequest { */ export interface GetAvailableSlotsResponse { /** - * @generated from protobuf field: repeated api.Slot Slots = 1 + * @generated from protobuf field: repeated api.SlotGroup SlotGroups = 1 */ - Slots: Slot[]; + SlotGroups: SlotGroup[]; // List of slot groups available for the current request } /** * BookAppointment @@ -1575,12 +1576,12 @@ export const GetAvailableSlotsRequest = new GetAvailableSlotsRequest$Type(); class GetAvailableSlotsResponse$Type extends MessageType { constructor() { super("api.GetAvailableSlotsResponse", [ - { no: 1, name: "Slots", kind: "message", localName: "Slots", jsonName: "Slots", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Slot } + { no: 1, name: "SlotGroups", kind: "message", localName: "SlotGroups", jsonName: "SlotGroups", repeat: 2 /*RepeatType.UNPACKED*/, T: () => SlotGroup } ]); } create(value?: PartialMessage): GetAvailableSlotsResponse { const message = globalThis.Object.create((this.messagePrototype!)); - message.Slots = []; + message.SlotGroups = []; if (value !== undefined) reflectionMergePartial(this, message, value); return message; @@ -1590,8 +1591,8 @@ class GetAvailableSlotsResponse$Type extends MessageType { + constructor() { + super("api.Commission", [ + { no: 1, name: "ProjectID", kind: "scalar", localName: "ProjectID", jsonName: "ProjectID", T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { string: { minLen: "1" } } } }, + { no: 2, name: "OrderID", kind: "scalar", localName: "OrderID", jsonName: "OrderID", T: 9 /*ScalarType.STRING*/ }, + { no: 3, name: "Quantities", kind: "message", localName: "Quantities", jsonName: "Quantities", repeat: 2 /*RepeatType.UNPACKED*/, T: () => QuantityByUnit, options: { "validate.rules": { repeated: { minItems: "1" } } } } + ]); + } + create(value?: PartialMessage): Commission { + const message = globalThis.Object.create((this.messagePrototype!)); + message.ProjectID = ""; + message.OrderID = ""; + message.Quantities = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Commission): Commission { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* string ProjectID */ 1: + message.ProjectID = reader.string(); + break; + case /* string OrderID */ 2: + message.OrderID = reader.string(); + break; + case /* repeated api.QuantityByUnit Quantities */ 3: + message.Quantities.push(QuantityByUnit.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Commission, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* string ProjectID = 1; */ + if (message.ProjectID !== "") + writer.tag(1, WireType.LengthDelimited).string(message.ProjectID); + /* string OrderID = 2; */ + if (message.OrderID !== "") + writer.tag(2, WireType.LengthDelimited).string(message.OrderID); + /* repeated api.QuantityByUnit Quantities = 3; */ + for (let i = 0; i < message.Quantities.length; i++) + QuantityByUnit.internalBinaryWrite(message.Quantities[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.Commission + */ +export const Commission = new Commission$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class Booking$Type extends MessageType { + constructor() { + super("api.Booking", [ + { no: 1, name: "AppointmentType", kind: "enum", localName: "AppointmentType", jsonName: "AppointmentType", T: () => ["api.AppointmentType", AppointmentType] }, + { no: 2, name: "Commissions", kind: "message", localName: "Commissions", jsonName: "Commissions", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Commission }, + { no: 3, name: "Segmentations", kind: "message", localName: "Segmentations", jsonName: "Segmentations", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Segmentation }, + { no: 4, name: "Slots", kind: "message", localName: "Slots", jsonName: "Slots", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Slot } + ]); + } + create(value?: PartialMessage): Booking { + const message = globalThis.Object.create((this.messagePrototype!)); + message.AppointmentType = 0; + message.Commissions = []; + message.Segmentations = []; + message.Slots = []; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Booking): Booking { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* api.AppointmentType AppointmentType */ 1: + message.AppointmentType = reader.int32(); + break; + case /* repeated api.Commission Commissions */ 2: + message.Commissions.push(Commission.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated api.Segmentation Segmentations */ 3: + message.Segmentations.push(Segmentation.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* repeated api.Slot Slots */ 4: + message.Slots.push(Slot.internalBinaryRead(reader, reader.uint32(), options)); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: Booking, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* api.AppointmentType AppointmentType = 1; */ + if (message.AppointmentType !== 0) + writer.tag(1, WireType.Varint).int32(message.AppointmentType); + /* repeated api.Commission Commissions = 2; */ + for (let i = 0; i < message.Commissions.length; i++) + Commission.internalBinaryWrite(message.Commissions[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join(); + /* repeated api.Segmentation Segmentations = 3; */ + for (let i = 0; i < message.Segmentations.length; i++) + Segmentation.internalBinaryWrite(message.Segmentations[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join(); + /* repeated api.Slot Slots = 4; */ + for (let i = 0; i < message.Slots.length; i++) + Slot.internalBinaryWrite(message.Slots[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join(); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.Booking + */ +export const Booking = new Booking$Type(); +// @generated message type with reflection information, may provide speed optimized methods +class SlotGroup$Type extends MessageType { + constructor() { + super("api.SlotGroup", [ + { no: 1, name: "Slots", kind: "message", localName: "Slots", jsonName: "Slots", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Slot }, + { no: 2, name: "Availability", kind: "scalar", localName: "Availability", jsonName: "Availability", T: 13 /*ScalarType.UINT32*/ } + ]); + } + create(value?: PartialMessage): SlotGroup { + const message = globalThis.Object.create((this.messagePrototype!)); + message.Slots = []; + message.Availability = 0; + if (value !== undefined) + reflectionMergePartial(this, message, value); + return message; + } + internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: SlotGroup): SlotGroup { + let message = target ?? this.create(), end = reader.pos + length; + while (reader.pos < end) { + let [fieldNo, wireType] = reader.tag(); + switch (fieldNo) { + case /* repeated api.Slot Slots */ 1: + message.Slots.push(Slot.internalBinaryRead(reader, reader.uint32(), options)); + break; + case /* uint32 Availability */ 2: + message.Availability = reader.uint32(); + break; + default: + let u = options.readUnknownField; + if (u === "throw") + throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`); + let d = reader.skip(wireType); + if (u !== false) + (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d); + } + } + return message; + } + internalBinaryWrite(message: SlotGroup, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter { + /* repeated api.Slot Slots = 1; */ + for (let i = 0; i < message.Slots.length; i++) + Slot.internalBinaryWrite(message.Slots[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join(); + /* uint32 Availability = 2; */ + if (message.Availability !== 0) + writer.tag(2, WireType.Varint).uint32(message.Availability); + let u = options.writeUnknownFields; + if (u !== false) + (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer); + return writer; + } +} +/** + * @generated MessageType for protobuf message api.SlotGroup + */ +export const SlotGroup = new SlotGroup$Type();