Files
npm-core-sdk/appointment.ts
2025-05-05 09:13:40 +00:00

352 lines
20 KiB
TypeScript

// @generated by protobuf-ts 2.10.0 with parameter use_proto_field_name
// @generated from protobuf file "appointment.proto" (package "api", syntax proto3)
// tslint:disable
import type { BinaryWriteOptions } from "@protobuf-ts/runtime";
import type { IBinaryWriter } from "@protobuf-ts/runtime";
import { WireType } from "@protobuf-ts/runtime";
import type { BinaryReadOptions } from "@protobuf-ts/runtime";
import type { IBinaryReader } from "@protobuf-ts/runtime";
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 { AppointmentStatusStruct } from "./collabShared";
import { Slot } from "./slotbooking";
import { CarrierInformation } from "./slotbooking";
import { Segmentation } from "./slotbooking";
import { QuantityByUnit } from "./slotbooking";
import { Commission } from "./collabShared";
import { AppointmentType } from "./slotbooking";
import { EntityID } from "./shared";
import { EventHeader } from "./shared";
// _common_
// import "visibility.proto";
/**
*
* Aggregation object message
*
* @generated from protobuf message api.Appointment
*/
export interface Appointment {
/**
* @generated from protobuf field: api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"];
*/
LastEventHeader?: EventHeader;
/**
* @generated from protobuf field: api.EntityID ID = 2 [json_name = "ID"];
*/
ID?: EntityID;
/**
* @generated from protobuf field: api.AppointmentPayload Payload = 3 [json_name = "Payload"];
*/
Payload?: AppointmentPayload;
}
/**
* @generated from protobuf message api.AppointmentPayload
*/
export interface AppointmentPayload {
/**
* Type of appointment : Expedition / Reception / Both
*
* @generated from protobuf field: api.AppointmentType AppointmentType = 1 [json_name = "AppointmentType"];
*/
AppointmentType: AppointmentType;
/**
* List of the orders and projects for which the appointment is made, with the quantities
* TODO ??
*
* @generated from protobuf field: repeated api.Commission Commissions = 2 [json_name = "Commissions"];
*/
Commissions: Commission[];
/**
* Cumulative quantity for all the commissions
*
* @generated from protobuf field: repeated api.QuantityByUnit QuantitiesByUnits = 3 [json_name = "QuantitiesByUnits"];
*/
QuantitiesByUnits: QuantityByUnit[];
/**
* Set of segmentation constraining the slot booking
*
* @generated from protobuf field: repeated api.Segmentation Segmentations = 4 [json_name = "Segmentations"];
*/
Segmentations: Segmentation[];
/**
* Required carrierInformation, some can be obligatory
*
* @generated from protobuf field: repeated api.CarrierInformation CarrierInformation = 5 [json_name = "CarrierInformation"];
*/
CarrierInformation: CarrierInformation[];
/**
* The slot booked for the appointment
*
* @generated from protobuf field: api.Slot Slot = 6 [json_name = "Slot"];
*/
Slot?: Slot;
/**
* User mails being notified on this appointment
* TODO Need to add a structure to store platform user identifiers which can act on this appointment ?
*
* @generated from protobuf field: repeated string Emails = 7 [json_name = "Emails"];
*/
Emails: string[];
/**
* Appointment Status and status history
*
* @generated from protobuf field: api.AppointmentStatusStruct Status = 8 [json_name = "Status"];
*/
Status?: AppointmentStatusStruct;
/**
* Creation date of the appointment
*
* @generated from protobuf field: string CreationDate = 9 [json_name = "CreationDate"];
*/
CreationDate: string;
}
/**
* @generated from protobuf message api.AppointmentTriplet
*/
export interface AppointmentTriplet {
/**
* @generated from protobuf field: api.Appointment Current = 1 [json_name = "Current"];
*/
Current?: Appointment;
/**
* @generated from protobuf field: api.Appointment Previous = 2 [json_name = "Previous"];
*/
Previous?: Appointment;
/**
* @generated from protobuf field: api.Appointment LastEvent = 3 [json_name = "LastEvent"];
*/
LastEvent?: Appointment;
}
// @generated message type with reflection information, may provide speed optimized methods
class Appointment$Type extends MessageType<Appointment> {
constructor() {
super("api.Appointment", [
{ no: 1, name: "LastEventHeader", kind: "message", localName: "LastEventHeader", jsonName: "LastEventHeader", T: () => EventHeader },
{ no: 2, name: "ID", kind: "message", localName: "ID", jsonName: "ID", T: () => EntityID },
{ no: 3, name: "Payload", kind: "message", localName: "Payload", jsonName: "Payload", T: () => AppointmentPayload }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { description: "Aggregation object message" } } });
}
create(value?: PartialMessage<Appointment>): Appointment {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<Appointment>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Appointment): Appointment {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"];*/ 1:
message.LastEventHeader = EventHeader.internalBinaryRead(reader, reader.uint32(), options, message.LastEventHeader);
break;
case /* api.EntityID ID = 2 [json_name = "ID"];*/ 2:
message.ID = EntityID.internalBinaryRead(reader, reader.uint32(), options, message.ID);
break;
case /* api.AppointmentPayload Payload = 3 [json_name = "Payload"];*/ 3:
message.Payload = AppointmentPayload.internalBinaryRead(reader, reader.uint32(), options, message.Payload);
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: Appointment, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.EventHeader LastEventHeader = 1 [json_name = "LastEventHeader"]; */
if (message.LastEventHeader)
EventHeader.internalBinaryWrite(message.LastEventHeader, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* api.EntityID ID = 2 [json_name = "ID"]; */
if (message.ID)
EntityID.internalBinaryWrite(message.ID, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* api.AppointmentPayload Payload = 3 [json_name = "Payload"]; */
if (message.Payload)
AppointmentPayload.internalBinaryWrite(message.Payload, 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.Appointment
*/
export const Appointment = new Appointment$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AppointmentPayload$Type extends MessageType<AppointmentPayload> {
constructor() {
super("api.AppointmentPayload", [
{ 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: "QuantitiesByUnits", kind: "message", localName: "QuantitiesByUnits", jsonName: "QuantitiesByUnits", repeat: 2 /*RepeatType.UNPACKED*/, T: () => QuantityByUnit },
{ no: 4, name: "Segmentations", kind: "message", localName: "Segmentations", jsonName: "Segmentations", repeat: 2 /*RepeatType.UNPACKED*/, T: () => Segmentation },
{ no: 5, name: "CarrierInformation", kind: "message", localName: "CarrierInformation", jsonName: "CarrierInformation", repeat: 2 /*RepeatType.UNPACKED*/, T: () => CarrierInformation },
{ no: 6, name: "Slot", kind: "message", localName: "Slot", jsonName: "Slot", T: () => Slot },
{ no: 7, name: "Emails", kind: "scalar", localName: "Emails", jsonName: "Emails", repeat: 2 /*RepeatType.UNPACKED*/, T: 9 /*ScalarType.STRING*/, options: { "validate.rules": { repeated: { minItems: "1", items: { string: { email: true, ignoreEmpty: true } } } }, "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Must be a valid email address", example: "[\"John.doe@reflex.com\", \"will.smith@reflex.com\"]" } } },
{ no: 8, name: "Status", kind: "message", localName: "Status", jsonName: "Status", T: () => AppointmentStatusStruct, options: { "api.aggSkip": "StatusUpdated", "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field": { description: "Status of the appointment" } } },
{ no: 9, name: "CreationDate", kind: "scalar", localName: "CreationDate", jsonName: "CreationDate", T: 9 /*ScalarType.STRING*/, options: { "api.viewType": { Types: [{ Context: "*", Type: "date" }] }, "validate.rules": { string: { dateIso8601: true } } } }
], { "grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema": { jsonSchema: { required: ["Segmentations"] } } });
}
create(value?: PartialMessage<AppointmentPayload>): AppointmentPayload {
const message = globalThis.Object.create((this.messagePrototype!));
message.AppointmentType = 0;
message.Commissions = [];
message.QuantitiesByUnits = [];
message.Segmentations = [];
message.CarrierInformation = [];
message.Emails = [];
message.CreationDate = "";
if (value !== undefined)
reflectionMergePartial<AppointmentPayload>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AppointmentPayload): AppointmentPayload {
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 [json_name = "AppointmentType"];*/ 1:
message.AppointmentType = reader.int32();
break;
case /* repeated api.Commission Commissions = 2 [json_name = "Commissions"];*/ 2:
message.Commissions.push(Commission.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated api.QuantityByUnit QuantitiesByUnits = 3 [json_name = "QuantitiesByUnits"];*/ 3:
message.QuantitiesByUnits.push(QuantityByUnit.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated api.Segmentation Segmentations = 4 [json_name = "Segmentations"];*/ 4:
message.Segmentations.push(Segmentation.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* repeated api.CarrierInformation CarrierInformation = 5 [json_name = "CarrierInformation"];*/ 5:
message.CarrierInformation.push(CarrierInformation.internalBinaryRead(reader, reader.uint32(), options));
break;
case /* api.Slot Slot = 6 [json_name = "Slot"];*/ 6:
message.Slot = Slot.internalBinaryRead(reader, reader.uint32(), options, message.Slot);
break;
case /* repeated string Emails = 7 [json_name = "Emails"];*/ 7:
message.Emails.push(reader.string());
break;
case /* api.AppointmentStatusStruct Status = 8 [json_name = "Status"];*/ 8:
message.Status = AppointmentStatusStruct.internalBinaryRead(reader, reader.uint32(), options, message.Status);
break;
case /* string CreationDate = 9 [json_name = "CreationDate"];*/ 9:
message.CreationDate = reader.string();
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: AppointmentPayload, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.AppointmentType AppointmentType = 1 [json_name = "AppointmentType"]; */
if (message.AppointmentType !== 0)
writer.tag(1, WireType.Varint).int32(message.AppointmentType);
/* repeated api.Commission Commissions = 2 [json_name = "Commissions"]; */
for (let i = 0; i < message.Commissions.length; i++)
Commission.internalBinaryWrite(message.Commissions[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* repeated api.QuantityByUnit QuantitiesByUnits = 3 [json_name = "QuantitiesByUnits"]; */
for (let i = 0; i < message.QuantitiesByUnits.length; i++)
QuantityByUnit.internalBinaryWrite(message.QuantitiesByUnits[i], writer.tag(3, WireType.LengthDelimited).fork(), options).join();
/* repeated api.Segmentation Segmentations = 4 [json_name = "Segmentations"]; */
for (let i = 0; i < message.Segmentations.length; i++)
Segmentation.internalBinaryWrite(message.Segmentations[i], writer.tag(4, WireType.LengthDelimited).fork(), options).join();
/* repeated api.CarrierInformation CarrierInformation = 5 [json_name = "CarrierInformation"]; */
for (let i = 0; i < message.CarrierInformation.length; i++)
CarrierInformation.internalBinaryWrite(message.CarrierInformation[i], writer.tag(5, WireType.LengthDelimited).fork(), options).join();
/* api.Slot Slot = 6 [json_name = "Slot"]; */
if (message.Slot)
Slot.internalBinaryWrite(message.Slot, writer.tag(6, WireType.LengthDelimited).fork(), options).join();
/* repeated string Emails = 7 [json_name = "Emails"]; */
for (let i = 0; i < message.Emails.length; i++)
writer.tag(7, WireType.LengthDelimited).string(message.Emails[i]);
/* api.AppointmentStatusStruct Status = 8 [json_name = "Status"]; */
if (message.Status)
AppointmentStatusStruct.internalBinaryWrite(message.Status, writer.tag(8, WireType.LengthDelimited).fork(), options).join();
/* string CreationDate = 9 [json_name = "CreationDate"]; */
if (message.CreationDate !== "")
writer.tag(9, WireType.LengthDelimited).string(message.CreationDate);
let u = options.writeUnknownFields;
if (u !== false)
(u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
return writer;
}
}
/**
* @generated MessageType for protobuf message api.AppointmentPayload
*/
export const AppointmentPayload = new AppointmentPayload$Type();
// @generated message type with reflection information, may provide speed optimized methods
class AppointmentTriplet$Type extends MessageType<AppointmentTriplet> {
constructor() {
super("api.AppointmentTriplet", [
{ no: 1, name: "Current", kind: "message", localName: "Current", jsonName: "Current", T: () => Appointment },
{ no: 2, name: "Previous", kind: "message", localName: "Previous", jsonName: "Previous", T: () => Appointment },
{ no: 3, name: "LastEvent", kind: "message", localName: "LastEvent", jsonName: "LastEvent", T: () => Appointment }
]);
}
create(value?: PartialMessage<AppointmentTriplet>): AppointmentTriplet {
const message = globalThis.Object.create((this.messagePrototype!));
if (value !== undefined)
reflectionMergePartial<AppointmentTriplet>(this, message, value);
return message;
}
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: AppointmentTriplet): AppointmentTriplet {
let message = target ?? this.create(), end = reader.pos + length;
while (reader.pos < end) {
let [fieldNo, wireType] = reader.tag();
switch (fieldNo) {
case /* api.Appointment Current = 1 [json_name = "Current"];*/ 1:
message.Current = Appointment.internalBinaryRead(reader, reader.uint32(), options, message.Current);
break;
case /* api.Appointment Previous = 2 [json_name = "Previous"];*/ 2:
message.Previous = Appointment.internalBinaryRead(reader, reader.uint32(), options, message.Previous);
break;
case /* api.Appointment LastEvent = 3 [json_name = "LastEvent"];*/ 3:
message.LastEvent = Appointment.internalBinaryRead(reader, reader.uint32(), options, message.LastEvent);
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: AppointmentTriplet, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
/* api.Appointment Current = 1 [json_name = "Current"]; */
if (message.Current)
Appointment.internalBinaryWrite(message.Current, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
/* api.Appointment Previous = 2 [json_name = "Previous"]; */
if (message.Previous)
Appointment.internalBinaryWrite(message.Previous, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
/* api.Appointment LastEvent = 3 [json_name = "LastEvent"]; */
if (message.LastEvent)
Appointment.internalBinaryWrite(message.LastEvent, 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.AppointmentTriplet
*/
export const AppointmentTriplet = new AppointmentTriplet$Type();