From 743f06687af89cedf5aa18b62d2bbcfc20cbcd69 Mon Sep 17 00:00:00 2001 From: ilhom Date: Tue, 14 Jul 2026 16:25:42 +0700 Subject: [PATCH 1/2] chore(finance): regenerate TS types for MB batch costing Generated ts-proto types for the MB costing suite (yarn_master + cost_product_master) and refreshed cost_product_request / buf.validate from goapps-shared-proto. Authored-By: Ilham R Co-Authored-By: Ilham R Co-Authored-By: Claude Opus 4.8 Co-Authored-By: IT Mutugading Co-Authored-By: IT Mutu Gading --- src/types/generated/buf/validate/validate.ts | 38 +- .../finance/v1/cost_product_master.ts | 220 + .../finance/v1/cost_product_request.ts | 20 +- src/types/generated/finance/v1/yarn_master.ts | 29050 +++++++++++----- 4 files changed, 19985 insertions(+), 9343 deletions(-) diff --git a/src/types/generated/buf/validate/validate.ts b/src/types/generated/buf/validate/validate.ts index 82ef5c5..7635fd4 100644 --- a/src/types/generated/buf/validate/validate.ts +++ b/src/types/generated/buf/validate/validate.ts @@ -1357,7 +1357,7 @@ export interface UInt64Rules { * message MyUInt64 { * uint64 value = 1 [ * (buf.validate.field).uint64.example = 1, - * (buf.validate.field).uint64.example = -10 + * (buf.validate.field).uint64.example = 10 * ]; * } * ``` @@ -2202,8 +2202,8 @@ export interface BoolRules { * ```proto * message MyBool { * bool value = 1 [ - * (buf.validate.field).bool.example = 1, - * (buf.validate.field).bool.example = 2 + * (buf.validate.field).bool.example = true, + * (buf.validate.field).bool.example = false * ]; * } * ``` @@ -2409,7 +2409,7 @@ export interface StringRules { * ```proto * message MyString { * // must be in list ["apple", "banana"] - * string value = 1 [(buf.validate.field).string.in = "apple", (buf.validate.field).string.in = "banana"]; + * string value = 1 [(buf.validate.field).string = { in: ["apple", "banana"] }]; * } * ``` */ @@ -2421,7 +2421,7 @@ export interface StringRules { * ```proto * message MyString { * // value must not be in list ["orange", "grape"] - * string value = 1 [(buf.validate.field).string.not_in = "orange", (buf.validate.field).string.not_in = "grape"]; + * string value = 1 [(buf.validate.field).string = { not_in: ["orange", "grape"] }]; * } * ``` */ @@ -3003,7 +3003,7 @@ export interface BytesRules { * ```proto * message MyBytes { * // value must in ["\x01\x02", "\x02\x03", "\x03\x04"] - * optional bytes value = 1 [(buf.validate.field).bytes.in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * optional bytes value = 1 [(buf.validate.field).bytes = { in: ["\x01\x02", "\x02\x03", "\x03\x04"] }]; * } * ``` */ @@ -3017,7 +3017,7 @@ export interface BytesRules { * ```proto * message MyBytes { * // value must not in ["\x01\x02", "\x02\x03", "\x03\x04"] - * optional bytes value = 1 [(buf.validate.field).bytes.not_in = {"\x01\x02", "\x02\x03", "\x03\x04"}]; + * optional bytes value = 1 [(buf.validate.field).bytes = { not_in: ["\x01\x02", "\x02\x03", "\x03\x04"] }]; * } * ``` */ @@ -3189,8 +3189,10 @@ export interface EnumRules { * } * * message MyMessage { + * MyEnum value = 1 [ * (buf.validate.field).enum.example = 1, * (buf.validate.field).enum.example = 2 + * ]; * } * ``` */ @@ -3382,7 +3384,7 @@ export interface DurationRules { * ```proto * message MyDuration { * // value must equal 5s - * google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = "5s"]; + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.const = { seconds: 5 }]; * } * ``` */ @@ -3397,7 +3399,7 @@ export interface DurationRules { * ```proto * message MyDuration { * // must be less than 5s - * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = "5s"]; + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lt = { seconds: 5 }]; * } * ``` */ @@ -3412,7 +3414,7 @@ export interface DurationRules { * ```proto * message MyDuration { * // must be less than or equal to 10s - * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = "10s"]; + * google.protobuf.Duration value = 1 [(buf.validate.field).duration.lte = { seconds: 10 }]; * } * ``` */ @@ -3473,7 +3475,9 @@ export interface DurationRules { * ```proto * message MyDuration { * // must be in list [1s, 2s, 3s] - * google.protobuf.Duration value = 1 [(buf.validate.field).duration.in = ["1s", "2s", "3s"]]; + * google.protobuf.Duration value = 1 [(buf.validate.field).duration = { + * in: [{ seconds: 1 }, { seconds: 2 }, { seconds: 3 }] + * }]; * } * ``` */ @@ -3487,7 +3491,9 @@ export interface DurationRules { * ```proto * message MyDuration { * // value must not be in list [1s, 2s, 3s] - * google.protobuf.Duration value = 1 [(buf.validate.field).duration.not_in = ["1s", "2s", "3s"]]; + * google.protobuf.Duration value = 1 [(buf.validate.field).duration = { + * not_in: [{ seconds: 1 }, { seconds: 2 }, { seconds: 3 }] + * }]; * } * ``` */ @@ -3501,7 +3507,7 @@ export interface DurationRules { * message MyDuration { * google.protobuf.Duration value = 1 [ * (buf.validate.field).duration.example = { seconds: 1 }, - * (buf.validate.field).duration.example = { seconds: 2 }, + * (buf.validate.field).duration.example = { seconds: 2 } * ]; * } * ``` @@ -3571,7 +3577,7 @@ export interface FieldMaskRules { * message MyFieldMask { * google.protobuf.FieldMask value = 1 [ * (buf.validate.field).field_mask.example = { paths: ["a", "b"] }, - * (buf.validate.field).field_mask.example = { paths: ["c.a", "d"] }, + * (buf.validate.field).field_mask.example = { paths: ["c.a", "d"] } * ]; * } * ``` @@ -3714,7 +3720,7 @@ export interface TimestampRules { * message MyTimestamp { * google.protobuf.Timestamp value = 1 [ * (buf.validate.field).timestamp.example = { seconds: 1672444800 }, - * (buf.validate.field).timestamp.example = { seconds: 1672531200 }, + * (buf.validate.field).timestamp.example = { seconds: 1672531200 } * ]; * } * ``` @@ -3815,7 +3821,7 @@ export interface Violation { * bool b = 2 [(buf.validate.field).cel = { * id: "custom_rule", * expression: "!this ? 'b must be true': ''" - * }] + * }]; * } * ``` * diff --git a/src/types/generated/finance/v1/cost_product_master.ts b/src/types/generated/finance/v1/cost_product_master.ts index 31a0a53..b5209c3 100644 --- a/src/types/generated/finance/v1/cost_product_master.ts +++ b/src/types/generated/finance/v1/cost_product_master.ts @@ -34,6 +34,10 @@ export interface CostProductMaster { flex01: string; flex02: string; flex03: string; + /** origin marker, e.g. "MB_RECIPE" when auto-generated; empty if manually created */ + source: string; + /** true blocks manual edits to route/params; escape hatch via UnlockCostProductMaster */ + isLocked: boolean; } export interface CreateCostProductMasterRequest { @@ -112,6 +116,16 @@ export interface DeactivateCostProductMasterResponse { base: BaseResponse | undefined; } +export interface UnlockCostProductMasterRequest { + productSysId: number; + reason: string; +} + +export interface UnlockCostProductMasterResponse { + base: BaseResponse | undefined; + data: CostProductMaster | undefined; +} + export interface ListCostProductMastersRequest { /** matches product_code OR product_name OR erp_item_code OR oracle sys id (flex_02) */ search: string; @@ -185,6 +199,8 @@ function createBaseCostProductMaster(): CostProductMaster { flex01: "", flex02: "", flex03: "", + source: "", + isLocked: false, }; } @@ -250,6 +266,12 @@ export const CostProductMaster: MessageFns = { if (message.flex03 !== "") { writer.uint32(162).string(message.flex03); } + if (message.source !== "") { + writer.uint32(170).string(message.source); + } + if (message.isLocked !== false) { + writer.uint32(176).bool(message.isLocked); + } return writer; }, @@ -420,6 +442,22 @@ export const CostProductMaster: MessageFns = { message.flex03 = reader.string(); continue; } + case 21: { + if (tag !== 170) { + break; + } + + message.source = reader.string(); + continue; + } + case 22: { + if (tag !== 176) { + break; + } + + message.isLocked = reader.bool(); + continue; + } } if ((tag & 7) === 4 || tag === 0) { break; @@ -523,6 +561,12 @@ export const CostProductMaster: MessageFns = { : isSet(object.flex_03) ? globalThis.String(object.flex_03) : "", + source: isSet(object.source) ? globalThis.String(object.source) : "", + isLocked: isSet(object.isLocked) + ? globalThis.Boolean(object.isLocked) + : isSet(object.is_locked) + ? globalThis.Boolean(object.is_locked) + : false, }; }, @@ -588,6 +632,12 @@ export const CostProductMaster: MessageFns = { if (message.flex03 !== "") { obj.flex03 = message.flex03; } + if (message.source !== "") { + obj.source = message.source; + } + if (message.isLocked !== false) { + obj.isLocked = message.isLocked; + } return obj; }, @@ -618,6 +668,8 @@ export const CostProductMaster: MessageFns = { message.flex01 = object.flex01 ?? ""; message.flex02 = object.flex02 ?? ""; message.flex03 = object.flex03 ?? ""; + message.source = object.source ?? ""; + message.isLocked = object.isLocked ?? false; return message; }, }; @@ -1818,6 +1870,166 @@ export const DeactivateCostProductMasterResponse: MessageFns = { + encode(message: UnlockCostProductMasterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.productSysId !== 0) { + writer.uint32(8).int64(message.productSysId); + } + if (message.reason !== "") { + writer.uint32(18).string(message.reason); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UnlockCostProductMasterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnlockCostProductMasterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.productSysId = longToNumber(reader.int64()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.reason = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UnlockCostProductMasterRequest { + return { + productSysId: isSet(object.productSysId) + ? globalThis.Number(object.productSysId) + : isSet(object.product_sys_id) + ? globalThis.Number(object.product_sys_id) + : 0, + reason: isSet(object.reason) ? globalThis.String(object.reason) : "", + }; + }, + + toJSON(message: UnlockCostProductMasterRequest): unknown { + const obj: any = {}; + if (message.productSysId !== 0) { + obj.productSysId = Math.round(message.productSysId); + } + if (message.reason !== "") { + obj.reason = message.reason; + } + return obj; + }, + + create(base?: DeepPartial): UnlockCostProductMasterRequest { + return UnlockCostProductMasterRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UnlockCostProductMasterRequest { + const message = createBaseUnlockCostProductMasterRequest(); + message.productSysId = object.productSysId ?? 0; + message.reason = object.reason ?? ""; + return message; + }, +}; + +function createBaseUnlockCostProductMasterResponse(): UnlockCostProductMasterResponse { + return { base: undefined, data: undefined }; +} + +export const UnlockCostProductMasterResponse: MessageFns = { + encode(message: UnlockCostProductMasterResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + CostProductMaster.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UnlockCostProductMasterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnlockCostProductMasterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = CostProductMaster.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UnlockCostProductMasterResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? CostProductMaster.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: UnlockCostProductMasterResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = CostProductMaster.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): UnlockCostProductMasterResponse { + return UnlockCostProductMasterResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UnlockCostProductMasterResponse { + const message = createBaseUnlockCostProductMasterResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? CostProductMaster.fromPartial(object.data) + : undefined; + return message; + }, +}; + function createBaseListCostProductMastersRequest(): ListCostProductMastersRequest { return { search: "", @@ -2721,6 +2933,14 @@ export const CostProductMasterServiceDefinition = { responseStream: false, options: {}, }, + unlockCostProductMaster: { + name: "UnlockCostProductMaster", + requestType: UnlockCostProductMasterRequest, + requestStream: false, + responseType: UnlockCostProductMasterResponse, + responseStream: false, + options: {}, + }, listCostProductMasters: { name: "ListCostProductMasters", requestType: ListCostProductMastersRequest, diff --git a/src/types/generated/finance/v1/cost_product_request.ts b/src/types/generated/finance/v1/cost_product_request.ts index 6be5329..e8cd59d 100644 --- a/src/types/generated/finance/v1/cost_product_request.ts +++ b/src/types/generated/finance/v1/cost_product_request.ts @@ -139,17 +139,29 @@ export interface CostProductRequest { } export interface SpecInput { - /** Deprecated for new writes: retained for historical rows, no longer populated by new writes. */ + /** + * Deprecated for new writes: retained for historical rows, no longer populated by new writes. + * Validation is skipped when empty so new writes (which always send "") pass. + */ rawMaterialType: string; productDescription: string; shadeId: number; /** Free-text or master shade code (e.g. NL, Z114S). Renamed from shade_custom_text — field number unchanged for wire compatibility. */ shadeCode: string; - /** Deprecated: retained for historical rows, no longer populated by new writes. Use tube_type instead. */ + /** + * Deprecated: retained for historical rows, no longer populated by new writes. Use tube_type instead. + * Validation is skipped when zero so new writes (which always send 0) pass. + */ paperTubeTypeId: number; - /** Deprecated for new writes: retained for historical rows, no longer populated by new writes. */ + /** + * Deprecated for new writes: retained for historical rows, no longer populated by new writes. + * Validation is skipped when empty so new writes (which always send "") pass. + */ weightPerBobbinKg: string; - /** Deprecated for new writes: retained for historical rows, no longer populated by new writes. */ + /** + * Deprecated for new writes: retained for historical rows, no longer populated by new writes. + * Validation is skipped when empty so new writes (which always send "") pass. + */ boxType: string; /** Human-readable shade name (e.g. Natural, Jet Black), mirrors cost_product_master's shade_name. */ shadeName: string; diff --git a/src/types/generated/finance/v1/yarn_master.ts b/src/types/generated/finance/v1/yarn_master.ts index 1f69b2f..53edc64 100644 --- a/src/types/generated/finance/v1/yarn_master.ts +++ b/src/types/generated/finance/v1/yarn_master.ts @@ -1364,8 +1364,52 @@ export interface MBHead { mbhCode?: | string | undefined; + /** MB Costing Suite workflow state (mbh_entry_status). One of DRAFT/SUBMITTED/APPROVED/VALIDATED/UN_APPROVED/REVOKED. */ + entryStatus: string; + /** Whether this MB is a bought-out item (no internal spinning cost). */ + isBoughtout: boolean; /** Audit metadata. */ - audit: AuditInfo | undefined; + audit: + | AuditInfo + | undefined; + /** Current composition version number (incremented on each validation). */ + currentVersion: number; + /** Total fixed machine cost. NUMERIC(20,6) as string. */ + machineFixedTotal: string; + /** Free-text reason captured on the most recent state transition. */ + stateReason: string; + /** Development code. */ + devCode: string; + /** Shade code. */ + shadeCode: string; + /** Shade name. */ + shadeName: string; + /** Cross-section descriptor. */ + crossSection: string; + /** Lusture code (references MbLusture.code). */ + lustureCode: string; + /** Generated cost-product ID once costing has been produced. */ + costProductId: number; + /** Timestamp when cost was last generated. */ + costGeneratedAt: string; + /** User who last generated the cost. */ + costGeneratedBy: string; + /** Frozen param snapshot at VALIDATED — waste parameter value (mirrors mst_mb_param). */ + paramWaste: string; + /** Frozen param snapshot at VALIDATED — quality loss parameter value. */ + paramQualityLoss: string; + /** Frozen param snapshot at VALIDATED — efficiency parameter value. */ + paramEfficiency: string; + /** Frozen param snapshot at VALIDATED — development expense parameter value. */ + paramDevExpense: string; + /** Frozen param snapshot at VALIDATED — packing parameter value. */ + paramPacking: string; + /** Frozen param snapshot at VALIDATED — MB production per day parameter value. */ + paramMbProdPerDay: string; + /** Frozen param snapshot at VALIDATED — throughput per hour; stores option code, e.g. "B". */ + paramThroughputPerHour: string; + /** Frozen param snapshot at VALIDATED — number of process; stores option code, e.g. "D". */ + paramNoOfProcess: string; } /** CreateMBHeadRequest is the request for creating an MB Head record. */ @@ -1409,7 +1453,29 @@ export interface CreateMBHeadRequest { | string | undefined; /** Optional Oracle CMBH_CODE (max 100 chars). */ - mbhCode?: string | undefined; + mbhCode?: + | string + | undefined; + /** Whether this MB is a bought-out item (no internal spinning cost). Immutable after creation. */ + mbhIsBoughtout: boolean; + /** Development code (max 50 chars). */ + mbhDevCode?: + | string + | undefined; + /** Shade code (max 20 chars). */ + mbhShadeCode?: + | string + | undefined; + /** Shade name (max 100 chars). */ + mbhShadeName?: + | string + | undefined; + /** Cross-section descriptor (max 20 chars). */ + mbhCrossSection?: + | string + | undefined; + /** Lusture code, references MbLusture.code (max 10 chars). */ + mbhLustureCode?: string | undefined; } /** CreateMBHeadResponse is the response for creating an MB Head record. */ @@ -1483,7 +1549,27 @@ export interface UpdateMBHeadRequest { | string | undefined; /** Optional Oracle CMBH_CODE (max 100 chars). */ - mbhCode?: string | undefined; + mbhCode?: + | string + | undefined; + /** Development code (max 50 chars). */ + mbhDevCode?: + | string + | undefined; + /** Shade code (max 20 chars). */ + mbhShadeCode?: + | string + | undefined; + /** Shade name (max 100 chars). */ + mbhShadeName?: + | string + | undefined; + /** Cross-section descriptor (max 20 chars). */ + mbhCrossSection?: + | string + | undefined; + /** Lusture code, references MbLusture.code (max 10 chars). */ + mbhLustureCode?: string | undefined; } /** UpdateMBHeadResponse is the response for updating an MB Head record. */ @@ -1596,6 +1682,90 @@ export interface DownloadMBHeadTemplateResponse { fileName: string; } +/** SubmitMBHeadRequest is the request for submitting an MB Head for approval. */ +export interface SubmitMBHeadRequest { + /** MB Head UUID. */ + mbhId: string; +} + +/** SubmitMBHeadResponse is the response for submitting an MB Head for approval. */ +export interface SubmitMBHeadResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Updated MB Head data. */ + data: MBHead | undefined; +} + +/** ApproveMBHeadRequest is the request for approving an MB Head. */ +export interface ApproveMBHeadRequest { + /** MB Head UUID. */ + mbhId: string; +} + +/** ApproveMBHeadResponse is the response for approving an MB Head. */ +export interface ApproveMBHeadResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Updated MB Head data. */ + data: MBHead | undefined; +} + +/** ValidateMBHeadRequest is the request for validating an MB Head (freezes cost/param snapshot). */ +export interface ValidateMBHeadRequest { + /** MB Head UUID. */ + mbhId: string; +} + +/** ValidateMBHeadResponse is the response for validating an MB Head. */ +export interface ValidateMBHeadResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Updated MB Head data. */ + data: MBHead | undefined; +} + +/** UnApproveMBHeadRequest is the request for reverting an MB Head out of the approved state. */ +export interface UnApproveMBHeadRequest { + /** MB Head UUID. */ + mbhId: string; + /** Reason for un-approving. */ + reason: string; +} + +/** UnApproveMBHeadResponse is the response for un-approving an MB Head. */ +export interface UnApproveMBHeadResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Updated MB Head data. */ + data: MBHead | undefined; +} + +/** RevokeMBHeadRequest is the request for revoking an MB Head. */ +export interface RevokeMBHeadRequest { + /** MB Head UUID. */ + mbhId: string; + /** Reason for revoking. Required. */ + reason: string; +} + +/** RevokeMBHeadResponse is the response for revoking an MB Head. */ +export interface RevokeMBHeadResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Updated MB Head data. */ + data: MBHead | undefined; +} + /** MBSpin represents a Melange Batch spin detail record (child of MBHead). */ export interface MBSpin { /** UUID primary key. */ @@ -2111,153 +2281,10912 @@ export interface ImportLookupMastersResponse { errors: string[]; } -function createBaseMachine(): Machine { - return { - machineId: "", - machineCode: "", - machineName: "", - mcType: "", - mcLocation: "", - noOfPosition: 0, - noOfEnd: 0, - mcSpeed: 0, - machineRpm: undefined, - mcEfficiency: 0, - powerPerDay: undefined, - isActive: false, - notes: "", - mpPerDay: undefined, - ohsPerDay: undefined, - audit: undefined, - sparesPerDay: undefined, - kgsLostChange: undefined, - vb1Qty: undefined, - vb2Qty: undefined, - vb3Qty: undefined, - vb4Qty: undefined, - vb5Qty: undefined, - mcPoyBobbinWeight: undefined, - mcTotFxdCst: undefined, - mcBobbinPerTrolly: undefined, - mcBoxCost: undefined, - mcCaptivePerBobbin: undefined, - mcWeightage: undefined, - }; +/** MbComposition represents a single composition line for an MB Head (editable while DRAFT). */ +export interface MbComposition { + /** UUID primary key. */ + mbcmId: string; + /** Parent MB Head UUID. */ + mbhId: string; + /** Display sequence number within the head. */ + seqNo: number; + /** Referenced RM group head UUID. */ + groupHeadId: string; + /** Composition percentage. NUMERIC(6,3) as string. */ + compositionPct: string; + /** Source type: GROUP/MB/CARRIER. */ + sourceType: string; + /** Referenced MB Head UUID when source_type is MB. Nullable, empty string if unset. */ + mbRefMbhId: string; + /** Whether this line represents the carrier component. */ + isCarrier: boolean; + /** Legacy Oracle system ID for reconciliation. */ + legacySysId: string; + /** Audit metadata. */ + audit: AuditInfo | undefined; } -export const Machine: MessageFns = { - encode(message: Machine, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.machineId !== "") { - writer.uint32(10).string(message.machineId); - } - if (message.machineCode !== "") { - writer.uint32(18).string(message.machineCode); - } - if (message.machineName !== "") { - writer.uint32(26).string(message.machineName); - } - if (message.mcType !== "") { - writer.uint32(34).string(message.mcType); - } - if (message.mcLocation !== "") { - writer.uint32(42).string(message.mcLocation); - } - if (message.noOfPosition !== 0) { - writer.uint32(48).int32(message.noOfPosition); - } - if (message.noOfEnd !== 0) { - writer.uint32(56).int32(message.noOfEnd); - } - if (message.mcSpeed !== 0) { - writer.uint32(65).double(message.mcSpeed); - } - if (message.machineRpm !== undefined) { - writer.uint32(73).double(message.machineRpm); - } - if (message.mcEfficiency !== 0) { - writer.uint32(81).double(message.mcEfficiency); - } - if (message.powerPerDay !== undefined) { - writer.uint32(89).double(message.powerPerDay); - } - if (message.isActive !== false) { - writer.uint32(96).bool(message.isActive); - } - if (message.notes !== "") { - writer.uint32(106).string(message.notes); - } - if (message.mpPerDay !== undefined) { - writer.uint32(113).double(message.mpPerDay); - } - if (message.ohsPerDay !== undefined) { - writer.uint32(121).double(message.ohsPerDay); - } - if (message.audit !== undefined) { - AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); - } - if (message.sparesPerDay !== undefined) { - writer.uint32(137).double(message.sparesPerDay); - } - if (message.kgsLostChange !== undefined) { - writer.uint32(145).double(message.kgsLostChange); - } - if (message.vb1Qty !== undefined) { - writer.uint32(153).double(message.vb1Qty); - } - if (message.vb2Qty !== undefined) { - writer.uint32(161).double(message.vb2Qty); - } - if (message.vb3Qty !== undefined) { - writer.uint32(169).double(message.vb3Qty); - } - if (message.vb4Qty !== undefined) { - writer.uint32(177).double(message.vb4Qty); - } - if (message.vb5Qty !== undefined) { - writer.uint32(185).double(message.vb5Qty); - } - if (message.mcPoyBobbinWeight !== undefined) { - writer.uint32(193).double(message.mcPoyBobbinWeight); - } - if (message.mcTotFxdCst !== undefined) { - writer.uint32(201).double(message.mcTotFxdCst); - } - if (message.mcBobbinPerTrolly !== undefined) { - writer.uint32(209).double(message.mcBobbinPerTrolly); - } - if (message.mcBoxCost !== undefined) { - writer.uint32(217).double(message.mcBoxCost); - } - if (message.mcCaptivePerBobbin !== undefined) { - writer.uint32(225).double(message.mcCaptivePerBobbin); - } - if (message.mcWeightage !== undefined) { - writer.uint32(233).double(message.mcWeightage); - } - return writer; - }, +/** MbCompositionVersion is a frozen snapshot of a composition line captured at validation time. */ +export interface MbCompositionVersion { + /** UUID primary key. */ + mbcvId: string; + /** Parent MB Head UUID. */ + mbhId: string; + /** Version number this snapshot belongs to. */ + version: number; + /** Timestamp when this version was validated. */ + validatedAt: string; + /** User who validated this version. */ + validatedBy: string; + /** Display sequence number within the head. */ + seqNo: number; + /** Referenced RM group head UUID. */ + groupHeadId: string; + /** Composition percentage. NUMERIC(6,3) as string. */ + compositionPct: string; + /** Source type: GROUP/MB/CARRIER. */ + sourceType: string; + /** Referenced MB Head UUID when source_type is MB. */ + mbRefMbhId: string; + /** Whether this line represents the carrier component. */ + isCarrier: boolean; +} + +/** MbLusture is a master lookup entry for MB lusture types. */ +export interface MbLusture { + /** UUID primary key. */ + mblId: string; + /** Unique lusture code. */ + code: string; + /** Display name. */ + displayName: string; + /** Full description. */ + fullDescription: string; + /** Category grouping. */ + category: string; + /** Whether the record is active. */ + isActive: boolean; + /** Display ordering hint. */ + displayOrder: number; + /** Audit metadata. */ + audit: AuditInfo | undefined; +} - decode(input: BinaryReader | Uint8Array, length?: number): Machine { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMachine(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } +/** MbParam is a master costing parameter definition (SCALAR or PICKLIST). */ +export interface MbParam { + /** UUID primary key. */ + mbpId: string; + /** Unique parameter code. */ + code: string; + /** Display name. */ + name: string; + /** Description. */ + description: string; + /** Parameter type: SCALAR/PICKLIST. */ + type: string; + /** Default numeric value. NUMERIC as string, empty if PICKLIST. */ + defaultValue: string; + /** Default option code, empty if SCALAR. */ + defaultOption: string; + /** Unit of measure label. */ + unit: string; + /** Display ordering hint. */ + displayOrder: number; + /** Whether the record is active. */ + isActive: boolean; + /** Audit metadata. */ + audit: + | AuditInfo + | undefined; + /** Picklist options, populated when type is PICKLIST. */ + options: MbParamOption[]; +} - message.machineId = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } +/** MbParamOption is a single picklist option belonging to an MbParam. */ +export interface MbParamOption { + /** UUID primary key. */ + mbpoId: string; + /** Parent parameter code. */ + mbpCode: string; + /** Option code. */ + code: string; + /** Numeric value represented by this option. */ + numericValue: string; + /** Description. */ + description: string; + /** Display ordering hint. */ + displayOrder: number; + /** Whether the record is active. */ + isActive: boolean; +} - message.machineCode = reader.string(); +/** MbCost represents a costed value for an MB Head for a given period and cost type. */ +export interface MbCost { + /** UUID primary key. */ + mbcId: string; + /** Parent MB Head UUID. */ + mbhId: string; + /** Period in YYYYMM format. */ + period: string; + /** Cost type: ACTUAL/SELLING/FORECAST. */ + costType: string; + /** Cost value. NUMERIC as string. */ + costValue: string; + /** Source cost-product-cost ID this value was pushed from. */ + sourceCpcId: number; + /** Timestamp when this value was pushed. */ + pushedAt: string; + /** User who pushed this value. */ + pushedBy: string; + /** Whether this cost row is active. */ + isActive: boolean; +} + +/** MbPushLog records a single push-to-head batch execution. */ +export interface MbPushLog { + /** UUID primary key. */ + mbplId: string; + /** Period in YYYYMM format. */ + period: string; + /** Timestamp when the push was executed. */ + pushedAt: string; + /** User who executed the push. */ + pushedBy: string; + /** Number of MB Heads affected. */ + mbCount: number; + /** Number of cost rows written. */ + rowCount: number; + /** Comma-separated cost types pushed. */ + costTypes: string; + /** Previous period, used for carry-forward comparisons. */ + previousPeriod: string; + /** Free-text notes. */ + notes: string; +} + +/** MbWorkflowLog records a single workflow state transition for an MB Head. */ +export interface MbWorkflowLog { + /** UUID primary key. */ + mbwlId: string; + /** Parent MB Head UUID. */ + mbhId: string; + /** State transitioned from. */ + fromState: string; + /** State transitioned to. */ + toState: string; + /** User who performed the transition. */ + actorUserId: string; + /** Timestamp of the transition. */ + actorAt: string; + /** Reason captured for the transition, if any. */ + reason: string; + /** Composition version at the time of the transition. */ + version: number; +} + +/** CreateMbCompositionRequest is the request for creating an MB composition line. */ +export interface CreateMbCompositionRequest { + /** Parent MB Head UUID. */ + mbhId: string; + /** Display sequence number within the head. */ + seqNo: number; + /** Referenced RM group head UUID. */ + groupHeadId: string; + /** Composition percentage. */ + compositionPct: string; + /** Source type: GROUP/MB/CARRIER. */ + sourceType: string; + /** Referenced MB Head UUID when source_type is MB. */ + mbRefMbhId: string; + /** Whether this line represents the carrier component. */ + isCarrier: boolean; +} + +/** CreateMbCompositionResponse is the response for creating an MB composition line. */ +export interface CreateMbCompositionResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Created composition line. */ + data: MbComposition | undefined; +} + +/** UpdateMbCompositionRequest is the request for updating an MB composition line. */ +export interface UpdateMbCompositionRequest { + /** Composition line UUID. */ + mbcmId: string; + /** Updated composition percentage. */ + compositionPct: string; + /** Updated referenced RM group head UUID. */ + groupHeadId: string; + /** Updated source type: GROUP/MB/CARRIER. */ + sourceType: string; + /** Updated referenced MB Head UUID when source_type is MB. */ + mbRefMbhId: string; + /** Updated carrier flag. */ + isCarrier: boolean; +} + +/** UpdateMbCompositionResponse is the response for updating an MB composition line. */ +export interface UpdateMbCompositionResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Updated composition line. */ + data: MbComposition | undefined; +} + +/** DeleteMbCompositionRequest is the request for deleting an MB composition line. */ +export interface DeleteMbCompositionRequest { + /** Composition line UUID. */ + mbcmId: string; +} + +/** DeleteMbCompositionResponse is the response for deleting an MB composition line. */ +export interface DeleteMbCompositionResponse { + /** Standard response metadata. */ + base: BaseResponse | undefined; +} + +/** ListMbCompositionsRequest is the request for listing composition lines for an MB Head. */ +export interface ListMbCompositionsRequest { + /** Parent MB Head UUID. */ + mbhId: string; +} + +/** ListMbCompositionsResponse is the response for listing composition lines. */ +export interface ListMbCompositionsResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Composition lines. */ + data: MbComposition[]; +} + +/** ListMbCompositionVersionsRequest is the request for listing frozen composition version snapshots. */ +export interface ListMbCompositionVersionsRequest { + /** Parent MB Head UUID. */ + mbhId: string; + /** Version number to fetch. 0 means latest. */ + version: number; +} + +/** ListMbCompositionVersionsResponse is the response for listing composition version snapshots. */ +export interface ListMbCompositionVersionsResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Composition version snapshot lines. */ + data: MbCompositionVersion[]; +} + +/** CreateMbLustureRequest is the request for creating an MB lusture master record. */ +export interface CreateMbLustureRequest { + /** Unique lusture code (1-10 chars). */ + code: string; + /** Display name. */ + displayName: string; + /** Full description. */ + fullDescription: string; + /** Category grouping. */ + category: string; + /** Whether the record is active. */ + isActive: boolean; + /** Display ordering hint. */ + displayOrder: number; +} + +/** CreateMbLustureResponse is the response for creating an MB lusture master record. */ +export interface CreateMbLustureResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Created lusture record. */ + data: MbLusture | undefined; +} + +/** UpdateMbLustureRequest is the request for updating an MB lusture master record. */ +export interface UpdateMbLustureRequest { + /** Lusture UUID. */ + mblId: string; + /** Updated display name. */ + displayName: string; + /** Updated full description. */ + fullDescription: string; + /** Updated category grouping. */ + category: string; + /** Updated active status. */ + isActive: boolean; + /** Updated display ordering hint. */ + displayOrder: number; +} + +/** UpdateMbLustureResponse is the response for updating an MB lusture master record. */ +export interface UpdateMbLustureResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Updated lusture record. */ + data: MbLusture | undefined; +} + +/** DeleteMbLustureRequest is the request for deleting an MB lusture master record. */ +export interface DeleteMbLustureRequest { + /** Lusture UUID. */ + mblId: string; +} + +/** DeleteMbLustureResponse is the response for deleting an MB lusture master record. */ +export interface DeleteMbLustureResponse { + /** Standard response metadata. */ + base: BaseResponse | undefined; +} + +/** GetMbLustureRequest is the request for retrieving an MB lusture master record by ID. */ +export interface GetMbLustureRequest { + /** Lusture UUID. */ + mblId: string; +} + +/** GetMbLustureResponse is the response for retrieving an MB lusture master record. */ +export interface GetMbLustureResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Lusture record. */ + data: MbLusture | undefined; +} + +/** ListMbLustureRequest is the request for listing MB lusture master records. */ +export interface ListMbLustureRequest { + /** Page number (≥ 1). */ + page: number; + /** Page size (1-100). */ + pageSize: number; + /** Full-text search across code and display_name. */ + search: string; + /** Sort field. */ + sortBy: string; + /** Sort direction. */ + sortDir: string; + /** Filter by active status. */ + activeFilter: ActiveFilter; +} + +/** ListMbLustureResponse is the response for listing MB lusture master records. */ +export interface ListMbLustureResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Lusture records. */ + data: MbLusture[]; + /** Pagination metadata. */ + pagination: PaginationResponse | undefined; +} + +/** ExportMbLustureRequest is the request for exporting MB lusture master records to Excel. */ +export interface ExportMbLustureRequest { + /** Filter by active status. */ + activeFilter: ActiveFilter; +} + +/** ExportMbLustureResponse is the response for exporting MB lusture master records. */ +export interface ExportMbLustureResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Excel file content. */ + fileContent: Uint8Array; + /** Excel file name. */ + fileName: string; +} + +/** ImportMbLustureRequest is the request for importing MB lusture master records from Excel. */ +export interface ImportMbLustureRequest { + /** Excel file content (max 10 MB). */ + fileContent: Uint8Array; + /** Excel file name. */ + fileName: string; + /** How to handle duplicate codes. */ + duplicateAction: string; +} + +/** ImportMbLustureResponse is the response for importing MB lusture master records. */ +export interface ImportMbLustureResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Number of successfully created records. */ + successCount: number; + /** Number of skipped records. */ + skippedCount: number; + /** Number of failed records. */ + failedCount: number; + /** Per-row import errors. */ + errors: ImportError[]; +} + +/** DownloadMbLustureTemplateRequest is the request for downloading the import template. */ +export interface DownloadMbLustureTemplateRequest { +} + +/** DownloadMbLustureTemplateResponse is the response for downloading the import template. */ +export interface DownloadMbLustureTemplateResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Excel template file content. */ + fileContent: Uint8Array; + /** Excel file name. */ + fileName: string; +} + +/** CreateMbParamRequest is the request for creating an MB costing parameter. */ +export interface CreateMbParamRequest { + /** Unique parameter code (1-30 chars). */ + code: string; + /** Display name. */ + name: string; + /** Description. */ + description: string; + /** Parameter type: SCALAR/PICKLIST. */ + type: string; + /** Default numeric value, empty if PICKLIST. */ + defaultValue: string; + /** Default option code, empty if SCALAR. */ + defaultOption: string; + /** Unit of measure label. */ + unit: string; + /** Display ordering hint. */ + displayOrder: number; + /** Whether the record is active. */ + isActive: boolean; +} + +/** CreateMbParamResponse is the response for creating an MB costing parameter. */ +export interface CreateMbParamResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Created parameter record. */ + data: MbParam | undefined; +} + +/** UpdateMbParamRequest is the request for updating an MB costing parameter. */ +export interface UpdateMbParamRequest { + /** Parameter UUID. */ + mbpId: string; + /** Updated display name. */ + name: string; + /** Updated description. */ + description: string; + /** Updated default numeric value. */ + defaultValue: string; + /** Updated default option code. */ + defaultOption: string; + /** Updated unit of measure label. */ + unit: string; + /** Updated display ordering hint. */ + displayOrder: number; + /** Updated active status. */ + isActive: boolean; +} + +/** UpdateMbParamResponse is the response for updating an MB costing parameter. */ +export interface UpdateMbParamResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Updated parameter record. */ + data: MbParam | undefined; +} + +/** DeleteMbParamRequest is the request for deleting an MB costing parameter. */ +export interface DeleteMbParamRequest { + /** Parameter UUID. */ + mbpId: string; +} + +/** DeleteMbParamResponse is the response for deleting an MB costing parameter. */ +export interface DeleteMbParamResponse { + /** Standard response metadata. */ + base: BaseResponse | undefined; +} + +/** ListMbParamsRequest is the request for listing MB costing parameters. */ +export interface ListMbParamsRequest { + /** Page number (≥ 1). */ + page: number; + /** Page size (1-100). */ + pageSize: number; + /** Full-text search across code and name. */ + search: string; + /** Sort field. */ + sortBy: string; + /** Sort direction. */ + sortDir: string; + /** Filter by active status. */ + activeFilter: ActiveFilter; +} + +/** ListMbParamsResponse is the response for listing MB costing parameters. */ +export interface ListMbParamsResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Parameter records. */ + data: MbParam[]; + /** Pagination metadata. */ + pagination: PaginationResponse | undefined; +} + +/** ExportMbParamsRequest is the request for exporting MB costing parameters to Excel. */ +export interface ExportMbParamsRequest { + /** Filter by active status. */ + activeFilter: ActiveFilter; +} + +/** ExportMbParamsResponse is the response for exporting MB costing parameters. */ +export interface ExportMbParamsResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Excel file content. */ + fileContent: Uint8Array; + /** Excel file name. */ + fileName: string; +} + +/** ImportMbParamsRequest is the request for importing MB costing parameters from Excel. */ +export interface ImportMbParamsRequest { + /** Excel file content (max 10 MB). */ + fileContent: Uint8Array; + /** Excel file name. */ + fileName: string; + /** How to handle duplicate codes. */ + duplicateAction: string; +} + +/** ImportMbParamsResponse is the response for importing MB costing parameters. */ +export interface ImportMbParamsResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Number of successfully created records. */ + successCount: number; + /** Number of skipped records. */ + skippedCount: number; + /** Number of failed records. */ + failedCount: number; + /** Per-row import errors. */ + errors: ImportError[]; +} + +/** DownloadMbParamTemplateRequest is the request for downloading the import template. */ +export interface DownloadMbParamTemplateRequest { +} + +/** DownloadMbParamTemplateResponse is the response for downloading the import template. */ +export interface DownloadMbParamTemplateResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Excel template file content. */ + fileContent: Uint8Array; + /** Excel file name. */ + fileName: string; +} + +/** CreateMbParamOptionRequest is the request for creating an MB param picklist option. */ +export interface CreateMbParamOptionRequest { + /** Parent parameter code. */ + mbpCode: string; + /** Option code (1-10 chars). */ + code: string; + /** Numeric value represented by this option. */ + numericValue: string; + /** Description. */ + description: string; + /** Display ordering hint. */ + displayOrder: number; + /** Whether the record is active. */ + isActive: boolean; +} + +/** CreateMbParamOptionResponse is the response for creating an MB param picklist option. */ +export interface CreateMbParamOptionResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Created option record. */ + data: MbParamOption | undefined; +} + +/** UpdateMbParamOptionRequest is the request for updating an MB param picklist option. */ +export interface UpdateMbParamOptionRequest { + /** Option UUID. */ + mbpoId: string; + /** Updated numeric value. */ + numericValue: string; + /** Updated description. */ + description: string; + /** Updated display ordering hint. */ + displayOrder: number; + /** Updated active status. */ + isActive: boolean; +} + +/** UpdateMbParamOptionResponse is the response for updating an MB param picklist option. */ +export interface UpdateMbParamOptionResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Updated option record. */ + data: MbParamOption | undefined; +} + +/** DeleteMbParamOptionRequest is the request for deleting an MB param picklist option. */ +export interface DeleteMbParamOptionRequest { + /** Option UUID. */ + mbpoId: string; +} + +/** DeleteMbParamOptionResponse is the response for deleting an MB param picklist option. */ +export interface DeleteMbParamOptionResponse { + /** Standard response metadata. */ + base: BaseResponse | undefined; +} + +/** PreviewPushToHeadRequest is the request for previewing which MB Heads are pushable for a period. */ +export interface PreviewPushToHeadRequest { + /** Period in YYYYMM format. */ + period: string; +} + +/** PushableMbHead describes an MB Head eligible to receive pushed costs for the previewed period. */ +export interface PushableMbHead { + /** MB Head UUID. */ + mbhId: string; + /** Batch cost code. */ + code: string; + /** Management display name. */ + name: string; + /** Whether an ACTUAL cost value is available to push. */ + hasActual: boolean; + /** Whether a SELLING cost value is available to push. */ + hasSelling: boolean; + /** Whether a FORECAST cost value is available to push. */ + hasForecast: boolean; +} + +/** SkippedMbHead describes an MB Head excluded from the push, with the reason why. */ +export interface SkippedMbHead { + /** MB Head UUID. */ + mbhId: string; + /** Batch cost code. */ + code: string; + /** Management display name. */ + name: string; + /** Reason this head was skipped. */ + reason: string; +} + +/** PreviewPushToHeadResponse is the response listing pushable and skipped MB Heads for a period. */ +export interface PreviewPushToHeadResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** MB Heads eligible for push. */ + pushable: PushableMbHead[]; + /** MB Heads excluded from push, with reasons. */ + skipped: SkippedMbHead[]; +} + +/** ExecutePushToHeadRequest is the request for executing a push-to-head batch for a period. */ +export interface ExecutePushToHeadRequest { + /** Period in YYYYMM format. */ + period: string; + /** MB Head UUIDs to push. */ + mbHeadIds: string[]; +} + +/** ExecutePushToHeadResponse is the response for executing a push-to-head batch. */ +export interface ExecutePushToHeadResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Resulting push log record. */ + data: MbPushLog | undefined; +} + +/** ListMbPushLogsRequest is the request for listing push-to-head batch logs. */ +export interface ListMbPushLogsRequest { + /** Page number (≥ 1). */ + page: number; + /** Page size (1-100). */ + pageSize: number; + /** Filter by period in YYYYMM format. Optional — omit or send empty for no filter. */ + period: string; +} + +/** ListMbPushLogsResponse is the response for listing push-to-head batch logs. */ +export interface ListMbPushLogsResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Push log records. */ + data: MbPushLog[]; + /** Pagination metadata. */ + pagination: PaginationResponse | undefined; +} + +/** ListMbWorkflowLogsRequest is the request for listing workflow transition logs for an MB Head. */ +export interface ListMbWorkflowLogsRequest { + /** Parent MB Head UUID. */ + mbhId: string; +} + +/** ListMbWorkflowLogsResponse is the response for listing workflow transition logs. */ +export interface ListMbWorkflowLogsResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Workflow log records. */ + data: MbWorkflowLog[]; +} + +/** + * TriggerMbBatchRequest is the request to compute cst_product_cost rows for every + * VALIDATED MB Head, for the given period, across all 3 calculation types. + */ +export interface TriggerMbBatchRequest { + /** Period in YYYYMM format. */ + period: string; +} + +/** MbBatchError records one MB Head's compute failure within a batch run. */ +export interface MbBatchError { + /** MB Head UUID. */ + mbhId: string; + /** Failure detail. */ + error: string; +} + +/** TriggerMbBatchResponse summarizes an MB_BATCH run's outcome. */ +export interface TriggerMbBatchResponse { + /** Standard response metadata. */ + base: + | BaseResponse + | undefined; + /** Underlying cal_job id created for this run. */ + jobId: number; + /** Period computed, in YYYYMM format. */ + period: string; + /** Count of MB Heads successfully computed. */ + successCount: number; + /** Count of MB Heads that failed to compute. */ + failedCount: number; + /** Total cst_product_cost rows inserted (3 per successful MB Head). */ + rowsInserted: number; + /** Wall-clock duration of the run, in milliseconds. */ + durationMs: number; + /** Per-MB failure details, one entry per failed MB Head. */ + errors: MbBatchError[]; +} + +function createBaseMachine(): Machine { + return { + machineId: "", + machineCode: "", + machineName: "", + mcType: "", + mcLocation: "", + noOfPosition: 0, + noOfEnd: 0, + mcSpeed: 0, + machineRpm: undefined, + mcEfficiency: 0, + powerPerDay: undefined, + isActive: false, + notes: "", + mpPerDay: undefined, + ohsPerDay: undefined, + audit: undefined, + sparesPerDay: undefined, + kgsLostChange: undefined, + vb1Qty: undefined, + vb2Qty: undefined, + vb3Qty: undefined, + vb4Qty: undefined, + vb5Qty: undefined, + mcPoyBobbinWeight: undefined, + mcTotFxdCst: undefined, + mcBobbinPerTrolly: undefined, + mcBoxCost: undefined, + mcCaptivePerBobbin: undefined, + mcWeightage: undefined, + }; +} + +export const Machine: MessageFns = { + encode(message: Machine, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.machineId !== "") { + writer.uint32(10).string(message.machineId); + } + if (message.machineCode !== "") { + writer.uint32(18).string(message.machineCode); + } + if (message.machineName !== "") { + writer.uint32(26).string(message.machineName); + } + if (message.mcType !== "") { + writer.uint32(34).string(message.mcType); + } + if (message.mcLocation !== "") { + writer.uint32(42).string(message.mcLocation); + } + if (message.noOfPosition !== 0) { + writer.uint32(48).int32(message.noOfPosition); + } + if (message.noOfEnd !== 0) { + writer.uint32(56).int32(message.noOfEnd); + } + if (message.mcSpeed !== 0) { + writer.uint32(65).double(message.mcSpeed); + } + if (message.machineRpm !== undefined) { + writer.uint32(73).double(message.machineRpm); + } + if (message.mcEfficiency !== 0) { + writer.uint32(81).double(message.mcEfficiency); + } + if (message.powerPerDay !== undefined) { + writer.uint32(89).double(message.powerPerDay); + } + if (message.isActive !== false) { + writer.uint32(96).bool(message.isActive); + } + if (message.notes !== "") { + writer.uint32(106).string(message.notes); + } + if (message.mpPerDay !== undefined) { + writer.uint32(113).double(message.mpPerDay); + } + if (message.ohsPerDay !== undefined) { + writer.uint32(121).double(message.ohsPerDay); + } + if (message.audit !== undefined) { + AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); + } + if (message.sparesPerDay !== undefined) { + writer.uint32(137).double(message.sparesPerDay); + } + if (message.kgsLostChange !== undefined) { + writer.uint32(145).double(message.kgsLostChange); + } + if (message.vb1Qty !== undefined) { + writer.uint32(153).double(message.vb1Qty); + } + if (message.vb2Qty !== undefined) { + writer.uint32(161).double(message.vb2Qty); + } + if (message.vb3Qty !== undefined) { + writer.uint32(169).double(message.vb3Qty); + } + if (message.vb4Qty !== undefined) { + writer.uint32(177).double(message.vb4Qty); + } + if (message.vb5Qty !== undefined) { + writer.uint32(185).double(message.vb5Qty); + } + if (message.mcPoyBobbinWeight !== undefined) { + writer.uint32(193).double(message.mcPoyBobbinWeight); + } + if (message.mcTotFxdCst !== undefined) { + writer.uint32(201).double(message.mcTotFxdCst); + } + if (message.mcBobbinPerTrolly !== undefined) { + writer.uint32(209).double(message.mcBobbinPerTrolly); + } + if (message.mcBoxCost !== undefined) { + writer.uint32(217).double(message.mcBoxCost); + } + if (message.mcCaptivePerBobbin !== undefined) { + writer.uint32(225).double(message.mcCaptivePerBobbin); + } + if (message.mcWeightage !== undefined) { + writer.uint32(233).double(message.mcWeightage); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Machine { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMachine(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.machineId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.machineCode = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.machineName = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.mcType = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.mcLocation = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.noOfPosition = reader.int32(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.noOfEnd = reader.int32(); + continue; + } + case 8: { + if (tag !== 65) { + break; + } + + message.mcSpeed = reader.double(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.machineRpm = reader.double(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.mcEfficiency = reader.double(); + continue; + } + case 11: { + if (tag !== 89) { + break; + } + + message.powerPerDay = reader.double(); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.isActive = reader.bool(); + continue; + } + case 13: { + if (tag !== 106) { + break; + } + + message.notes = reader.string(); + continue; + } + case 14: { + if (tag !== 113) { + break; + } + + message.mpPerDay = reader.double(); + continue; + } + case 15: { + if (tag !== 121) { + break; + } + + message.ohsPerDay = reader.double(); + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.audit = AuditInfo.decode(reader, reader.uint32()); + continue; + } + case 17: { + if (tag !== 137) { + break; + } + + message.sparesPerDay = reader.double(); + continue; + } + case 18: { + if (tag !== 145) { + break; + } + + message.kgsLostChange = reader.double(); + continue; + } + case 19: { + if (tag !== 153) { + break; + } + + message.vb1Qty = reader.double(); + continue; + } + case 20: { + if (tag !== 161) { + break; + } + + message.vb2Qty = reader.double(); + continue; + } + case 21: { + if (tag !== 169) { + break; + } + + message.vb3Qty = reader.double(); + continue; + } + case 22: { + if (tag !== 177) { + break; + } + + message.vb4Qty = reader.double(); + continue; + } + case 23: { + if (tag !== 185) { + break; + } + + message.vb5Qty = reader.double(); + continue; + } + case 24: { + if (tag !== 193) { + break; + } + + message.mcPoyBobbinWeight = reader.double(); + continue; + } + case 25: { + if (tag !== 201) { + break; + } + + message.mcTotFxdCst = reader.double(); + continue; + } + case 26: { + if (tag !== 209) { + break; + } + + message.mcBobbinPerTrolly = reader.double(); + continue; + } + case 27: { + if (tag !== 217) { + break; + } + + message.mcBoxCost = reader.double(); + continue; + } + case 28: { + if (tag !== 225) { + break; + } + + message.mcCaptivePerBobbin = reader.double(); + continue; + } + case 29: { + if (tag !== 233) { + break; + } + + message.mcWeightage = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Machine { + return { + machineId: isSet(object.machineId) + ? globalThis.String(object.machineId) + : isSet(object.machine_id) + ? globalThis.String(object.machine_id) + : "", + machineCode: isSet(object.machineCode) + ? globalThis.String(object.machineCode) + : isSet(object.machine_code) + ? globalThis.String(object.machine_code) + : "", + machineName: isSet(object.machineName) + ? globalThis.String(object.machineName) + : isSet(object.machine_name) + ? globalThis.String(object.machine_name) + : "", + mcType: isSet(object.mcType) + ? globalThis.String(object.mcType) + : isSet(object.mc_type) + ? globalThis.String(object.mc_type) + : "", + mcLocation: isSet(object.mcLocation) + ? globalThis.String(object.mcLocation) + : isSet(object.mc_location) + ? globalThis.String(object.mc_location) + : "", + noOfPosition: isSet(object.noOfPosition) + ? globalThis.Number(object.noOfPosition) + : isSet(object.no_of_position) + ? globalThis.Number(object.no_of_position) + : 0, + noOfEnd: isSet(object.noOfEnd) + ? globalThis.Number(object.noOfEnd) + : isSet(object.no_of_end) + ? globalThis.Number(object.no_of_end) + : 0, + mcSpeed: isSet(object.mcSpeed) + ? globalThis.Number(object.mcSpeed) + : isSet(object.mc_speed) + ? globalThis.Number(object.mc_speed) + : 0, + machineRpm: isSet(object.machineRpm) + ? globalThis.Number(object.machineRpm) + : isSet(object.machine_rpm) + ? globalThis.Number(object.machine_rpm) + : undefined, + mcEfficiency: isSet(object.mcEfficiency) + ? globalThis.Number(object.mcEfficiency) + : isSet(object.mc_efficiency) + ? globalThis.Number(object.mc_efficiency) + : 0, + powerPerDay: isSet(object.powerPerDay) + ? globalThis.Number(object.powerPerDay) + : isSet(object.power_per_day) + ? globalThis.Number(object.power_per_day) + : undefined, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, + notes: isSet(object.notes) ? globalThis.String(object.notes) : "", + mpPerDay: isSet(object.mpPerDay) + ? globalThis.Number(object.mpPerDay) + : isSet(object.mp_per_day) + ? globalThis.Number(object.mp_per_day) + : undefined, + ohsPerDay: isSet(object.ohsPerDay) + ? globalThis.Number(object.ohsPerDay) + : isSet(object.ohs_per_day) + ? globalThis.Number(object.ohs_per_day) + : undefined, + audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, + sparesPerDay: isSet(object.sparesPerDay) + ? globalThis.Number(object.sparesPerDay) + : isSet(object.spares_per_day) + ? globalThis.Number(object.spares_per_day) + : undefined, + kgsLostChange: isSet(object.kgsLostChange) + ? globalThis.Number(object.kgsLostChange) + : isSet(object.kgs_lost_change) + ? globalThis.Number(object.kgs_lost_change) + : undefined, + vb1Qty: isSet(object.vb1Qty) + ? globalThis.Number(object.vb1Qty) + : isSet(object.vb1_qty) + ? globalThis.Number(object.vb1_qty) + : undefined, + vb2Qty: isSet(object.vb2Qty) + ? globalThis.Number(object.vb2Qty) + : isSet(object.vb2_qty) + ? globalThis.Number(object.vb2_qty) + : undefined, + vb3Qty: isSet(object.vb3Qty) + ? globalThis.Number(object.vb3Qty) + : isSet(object.vb3_qty) + ? globalThis.Number(object.vb3_qty) + : undefined, + vb4Qty: isSet(object.vb4Qty) + ? globalThis.Number(object.vb4Qty) + : isSet(object.vb4_qty) + ? globalThis.Number(object.vb4_qty) + : undefined, + vb5Qty: isSet(object.vb5Qty) + ? globalThis.Number(object.vb5Qty) + : isSet(object.vb5_qty) + ? globalThis.Number(object.vb5_qty) + : undefined, + mcPoyBobbinWeight: isSet(object.mcPoyBobbinWeight) + ? globalThis.Number(object.mcPoyBobbinWeight) + : isSet(object.mc_poy_bobbin_weight) + ? globalThis.Number(object.mc_poy_bobbin_weight) + : undefined, + mcTotFxdCst: isSet(object.mcTotFxdCst) + ? globalThis.Number(object.mcTotFxdCst) + : isSet(object.mc_tot_fxd_cst) + ? globalThis.Number(object.mc_tot_fxd_cst) + : undefined, + mcBobbinPerTrolly: isSet(object.mcBobbinPerTrolly) + ? globalThis.Number(object.mcBobbinPerTrolly) + : isSet(object.mc_bobbin_per_trolly) + ? globalThis.Number(object.mc_bobbin_per_trolly) + : undefined, + mcBoxCost: isSet(object.mcBoxCost) + ? globalThis.Number(object.mcBoxCost) + : isSet(object.mc_box_cost) + ? globalThis.Number(object.mc_box_cost) + : undefined, + mcCaptivePerBobbin: isSet(object.mcCaptivePerBobbin) + ? globalThis.Number(object.mcCaptivePerBobbin) + : isSet(object.mc_captive_per_bobbin) + ? globalThis.Number(object.mc_captive_per_bobbin) + : undefined, + mcWeightage: isSet(object.mcWeightage) + ? globalThis.Number(object.mcWeightage) + : isSet(object.mc_weightage) + ? globalThis.Number(object.mc_weightage) + : undefined, + }; + }, + + toJSON(message: Machine): unknown { + const obj: any = {}; + if (message.machineId !== "") { + obj.machineId = message.machineId; + } + if (message.machineCode !== "") { + obj.machineCode = message.machineCode; + } + if (message.machineName !== "") { + obj.machineName = message.machineName; + } + if (message.mcType !== "") { + obj.mcType = message.mcType; + } + if (message.mcLocation !== "") { + obj.mcLocation = message.mcLocation; + } + if (message.noOfPosition !== 0) { + obj.noOfPosition = Math.round(message.noOfPosition); + } + if (message.noOfEnd !== 0) { + obj.noOfEnd = Math.round(message.noOfEnd); + } + if (message.mcSpeed !== 0) { + obj.mcSpeed = message.mcSpeed; + } + if (message.machineRpm !== undefined) { + obj.machineRpm = message.machineRpm; + } + if (message.mcEfficiency !== 0) { + obj.mcEfficiency = message.mcEfficiency; + } + if (message.powerPerDay !== undefined) { + obj.powerPerDay = message.powerPerDay; + } + if (message.isActive !== false) { + obj.isActive = message.isActive; + } + if (message.notes !== "") { + obj.notes = message.notes; + } + if (message.mpPerDay !== undefined) { + obj.mpPerDay = message.mpPerDay; + } + if (message.ohsPerDay !== undefined) { + obj.ohsPerDay = message.ohsPerDay; + } + if (message.audit !== undefined) { + obj.audit = AuditInfo.toJSON(message.audit); + } + if (message.sparesPerDay !== undefined) { + obj.sparesPerDay = message.sparesPerDay; + } + if (message.kgsLostChange !== undefined) { + obj.kgsLostChange = message.kgsLostChange; + } + if (message.vb1Qty !== undefined) { + obj.vb1Qty = message.vb1Qty; + } + if (message.vb2Qty !== undefined) { + obj.vb2Qty = message.vb2Qty; + } + if (message.vb3Qty !== undefined) { + obj.vb3Qty = message.vb3Qty; + } + if (message.vb4Qty !== undefined) { + obj.vb4Qty = message.vb4Qty; + } + if (message.vb5Qty !== undefined) { + obj.vb5Qty = message.vb5Qty; + } + if (message.mcPoyBobbinWeight !== undefined) { + obj.mcPoyBobbinWeight = message.mcPoyBobbinWeight; + } + if (message.mcTotFxdCst !== undefined) { + obj.mcTotFxdCst = message.mcTotFxdCst; + } + if (message.mcBobbinPerTrolly !== undefined) { + obj.mcBobbinPerTrolly = message.mcBobbinPerTrolly; + } + if (message.mcBoxCost !== undefined) { + obj.mcBoxCost = message.mcBoxCost; + } + if (message.mcCaptivePerBobbin !== undefined) { + obj.mcCaptivePerBobbin = message.mcCaptivePerBobbin; + } + if (message.mcWeightage !== undefined) { + obj.mcWeightage = message.mcWeightage; + } + return obj; + }, + + create(base?: DeepPartial): Machine { + return Machine.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Machine { + const message = createBaseMachine(); + message.machineId = object.machineId ?? ""; + message.machineCode = object.machineCode ?? ""; + message.machineName = object.machineName ?? ""; + message.mcType = object.mcType ?? ""; + message.mcLocation = object.mcLocation ?? ""; + message.noOfPosition = object.noOfPosition ?? 0; + message.noOfEnd = object.noOfEnd ?? 0; + message.mcSpeed = object.mcSpeed ?? 0; + message.machineRpm = object.machineRpm ?? undefined; + message.mcEfficiency = object.mcEfficiency ?? 0; + message.powerPerDay = object.powerPerDay ?? undefined; + message.isActive = object.isActive ?? false; + message.notes = object.notes ?? ""; + message.mpPerDay = object.mpPerDay ?? undefined; + message.ohsPerDay = object.ohsPerDay ?? undefined; + message.audit = (object.audit !== undefined && object.audit !== null) + ? AuditInfo.fromPartial(object.audit) + : undefined; + message.sparesPerDay = object.sparesPerDay ?? undefined; + message.kgsLostChange = object.kgsLostChange ?? undefined; + message.vb1Qty = object.vb1Qty ?? undefined; + message.vb2Qty = object.vb2Qty ?? undefined; + message.vb3Qty = object.vb3Qty ?? undefined; + message.vb4Qty = object.vb4Qty ?? undefined; + message.vb5Qty = object.vb5Qty ?? undefined; + message.mcPoyBobbinWeight = object.mcPoyBobbinWeight ?? undefined; + message.mcTotFxdCst = object.mcTotFxdCst ?? undefined; + message.mcBobbinPerTrolly = object.mcBobbinPerTrolly ?? undefined; + message.mcBoxCost = object.mcBoxCost ?? undefined; + message.mcCaptivePerBobbin = object.mcCaptivePerBobbin ?? undefined; + message.mcWeightage = object.mcWeightage ?? undefined; + return message; + }, +}; + +function createBaseCreateMachineRequest(): CreateMachineRequest { + return { + machineCode: "", + machineName: "", + mcType: "", + mcLocation: "", + noOfPosition: 0, + noOfEnd: 0, + mcSpeed: 0, + machineRpm: undefined, + mcEfficiency: 0, + powerPerDay: undefined, + notes: "", + mpPerDay: undefined, + ohsPerDay: undefined, + sparesPerDay: undefined, + kgsLostChange: undefined, + vb1Qty: undefined, + vb2Qty: undefined, + vb3Qty: undefined, + vb4Qty: undefined, + vb5Qty: undefined, + mcPoyBobbinWeight: undefined, + mcTotFxdCst: undefined, + mcBobbinPerTrolly: undefined, + mcBoxCost: undefined, + mcCaptivePerBobbin: undefined, + mcWeightage: undefined, + }; +} + +export const CreateMachineRequest: MessageFns = { + encode(message: CreateMachineRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.machineCode !== "") { + writer.uint32(10).string(message.machineCode); + } + if (message.machineName !== "") { + writer.uint32(18).string(message.machineName); + } + if (message.mcType !== "") { + writer.uint32(26).string(message.mcType); + } + if (message.mcLocation !== "") { + writer.uint32(34).string(message.mcLocation); + } + if (message.noOfPosition !== 0) { + writer.uint32(40).int32(message.noOfPosition); + } + if (message.noOfEnd !== 0) { + writer.uint32(48).int32(message.noOfEnd); + } + if (message.mcSpeed !== 0) { + writer.uint32(57).double(message.mcSpeed); + } + if (message.machineRpm !== undefined) { + writer.uint32(65).double(message.machineRpm); + } + if (message.mcEfficiency !== 0) { + writer.uint32(73).double(message.mcEfficiency); + } + if (message.powerPerDay !== undefined) { + writer.uint32(81).double(message.powerPerDay); + } + if (message.notes !== "") { + writer.uint32(90).string(message.notes); + } + if (message.mpPerDay !== undefined) { + writer.uint32(97).double(message.mpPerDay); + } + if (message.ohsPerDay !== undefined) { + writer.uint32(105).double(message.ohsPerDay); + } + if (message.sparesPerDay !== undefined) { + writer.uint32(113).double(message.sparesPerDay); + } + if (message.kgsLostChange !== undefined) { + writer.uint32(121).double(message.kgsLostChange); + } + if (message.vb1Qty !== undefined) { + writer.uint32(129).double(message.vb1Qty); + } + if (message.vb2Qty !== undefined) { + writer.uint32(137).double(message.vb2Qty); + } + if (message.vb3Qty !== undefined) { + writer.uint32(145).double(message.vb3Qty); + } + if (message.vb4Qty !== undefined) { + writer.uint32(153).double(message.vb4Qty); + } + if (message.vb5Qty !== undefined) { + writer.uint32(161).double(message.vb5Qty); + } + if (message.mcPoyBobbinWeight !== undefined) { + writer.uint32(169).double(message.mcPoyBobbinWeight); + } + if (message.mcTotFxdCst !== undefined) { + writer.uint32(177).double(message.mcTotFxdCst); + } + if (message.mcBobbinPerTrolly !== undefined) { + writer.uint32(185).double(message.mcBobbinPerTrolly); + } + if (message.mcBoxCost !== undefined) { + writer.uint32(193).double(message.mcBoxCost); + } + if (message.mcCaptivePerBobbin !== undefined) { + writer.uint32(201).double(message.mcCaptivePerBobbin); + } + if (message.mcWeightage !== undefined) { + writer.uint32(209).double(message.mcWeightage); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateMachineRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMachineRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.machineCode = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.machineName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.mcType = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.mcLocation = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.noOfPosition = reader.int32(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.noOfEnd = reader.int32(); + continue; + } + case 7: { + if (tag !== 57) { + break; + } + + message.mcSpeed = reader.double(); + continue; + } + case 8: { + if (tag !== 65) { + break; + } + + message.machineRpm = reader.double(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.mcEfficiency = reader.double(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.powerPerDay = reader.double(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.notes = reader.string(); + continue; + } + case 12: { + if (tag !== 97) { + break; + } + + message.mpPerDay = reader.double(); + continue; + } + case 13: { + if (tag !== 105) { + break; + } + + message.ohsPerDay = reader.double(); + continue; + } + case 14: { + if (tag !== 113) { + break; + } + + message.sparesPerDay = reader.double(); + continue; + } + case 15: { + if (tag !== 121) { + break; + } + + message.kgsLostChange = reader.double(); + continue; + } + case 16: { + if (tag !== 129) { + break; + } + + message.vb1Qty = reader.double(); + continue; + } + case 17: { + if (tag !== 137) { + break; + } + + message.vb2Qty = reader.double(); + continue; + } + case 18: { + if (tag !== 145) { + break; + } + + message.vb3Qty = reader.double(); + continue; + } + case 19: { + if (tag !== 153) { + break; + } + + message.vb4Qty = reader.double(); + continue; + } + case 20: { + if (tag !== 161) { + break; + } + + message.vb5Qty = reader.double(); + continue; + } + case 21: { + if (tag !== 169) { + break; + } + + message.mcPoyBobbinWeight = reader.double(); + continue; + } + case 22: { + if (tag !== 177) { + break; + } + + message.mcTotFxdCst = reader.double(); + continue; + } + case 23: { + if (tag !== 185) { + break; + } + + message.mcBobbinPerTrolly = reader.double(); + continue; + } + case 24: { + if (tag !== 193) { + break; + } + + message.mcBoxCost = reader.double(); + continue; + } + case 25: { + if (tag !== 201) { + break; + } + + message.mcCaptivePerBobbin = reader.double(); + continue; + } + case 26: { + if (tag !== 209) { + break; + } + + message.mcWeightage = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CreateMachineRequest { + return { + machineCode: isSet(object.machineCode) + ? globalThis.String(object.machineCode) + : isSet(object.machine_code) + ? globalThis.String(object.machine_code) + : "", + machineName: isSet(object.machineName) + ? globalThis.String(object.machineName) + : isSet(object.machine_name) + ? globalThis.String(object.machine_name) + : "", + mcType: isSet(object.mcType) + ? globalThis.String(object.mcType) + : isSet(object.mc_type) + ? globalThis.String(object.mc_type) + : "", + mcLocation: isSet(object.mcLocation) + ? globalThis.String(object.mcLocation) + : isSet(object.mc_location) + ? globalThis.String(object.mc_location) + : "", + noOfPosition: isSet(object.noOfPosition) + ? globalThis.Number(object.noOfPosition) + : isSet(object.no_of_position) + ? globalThis.Number(object.no_of_position) + : 0, + noOfEnd: isSet(object.noOfEnd) + ? globalThis.Number(object.noOfEnd) + : isSet(object.no_of_end) + ? globalThis.Number(object.no_of_end) + : 0, + mcSpeed: isSet(object.mcSpeed) + ? globalThis.Number(object.mcSpeed) + : isSet(object.mc_speed) + ? globalThis.Number(object.mc_speed) + : 0, + machineRpm: isSet(object.machineRpm) + ? globalThis.Number(object.machineRpm) + : isSet(object.machine_rpm) + ? globalThis.Number(object.machine_rpm) + : undefined, + mcEfficiency: isSet(object.mcEfficiency) + ? globalThis.Number(object.mcEfficiency) + : isSet(object.mc_efficiency) + ? globalThis.Number(object.mc_efficiency) + : 0, + powerPerDay: isSet(object.powerPerDay) + ? globalThis.Number(object.powerPerDay) + : isSet(object.power_per_day) + ? globalThis.Number(object.power_per_day) + : undefined, + notes: isSet(object.notes) ? globalThis.String(object.notes) : "", + mpPerDay: isSet(object.mpPerDay) + ? globalThis.Number(object.mpPerDay) + : isSet(object.mp_per_day) + ? globalThis.Number(object.mp_per_day) + : undefined, + ohsPerDay: isSet(object.ohsPerDay) + ? globalThis.Number(object.ohsPerDay) + : isSet(object.ohs_per_day) + ? globalThis.Number(object.ohs_per_day) + : undefined, + sparesPerDay: isSet(object.sparesPerDay) + ? globalThis.Number(object.sparesPerDay) + : isSet(object.spares_per_day) + ? globalThis.Number(object.spares_per_day) + : undefined, + kgsLostChange: isSet(object.kgsLostChange) + ? globalThis.Number(object.kgsLostChange) + : isSet(object.kgs_lost_change) + ? globalThis.Number(object.kgs_lost_change) + : undefined, + vb1Qty: isSet(object.vb1Qty) + ? globalThis.Number(object.vb1Qty) + : isSet(object.vb1_qty) + ? globalThis.Number(object.vb1_qty) + : undefined, + vb2Qty: isSet(object.vb2Qty) + ? globalThis.Number(object.vb2Qty) + : isSet(object.vb2_qty) + ? globalThis.Number(object.vb2_qty) + : undefined, + vb3Qty: isSet(object.vb3Qty) + ? globalThis.Number(object.vb3Qty) + : isSet(object.vb3_qty) + ? globalThis.Number(object.vb3_qty) + : undefined, + vb4Qty: isSet(object.vb4Qty) + ? globalThis.Number(object.vb4Qty) + : isSet(object.vb4_qty) + ? globalThis.Number(object.vb4_qty) + : undefined, + vb5Qty: isSet(object.vb5Qty) + ? globalThis.Number(object.vb5Qty) + : isSet(object.vb5_qty) + ? globalThis.Number(object.vb5_qty) + : undefined, + mcPoyBobbinWeight: isSet(object.mcPoyBobbinWeight) + ? globalThis.Number(object.mcPoyBobbinWeight) + : isSet(object.mc_poy_bobbin_weight) + ? globalThis.Number(object.mc_poy_bobbin_weight) + : undefined, + mcTotFxdCst: isSet(object.mcTotFxdCst) + ? globalThis.Number(object.mcTotFxdCst) + : isSet(object.mc_tot_fxd_cst) + ? globalThis.Number(object.mc_tot_fxd_cst) + : undefined, + mcBobbinPerTrolly: isSet(object.mcBobbinPerTrolly) + ? globalThis.Number(object.mcBobbinPerTrolly) + : isSet(object.mc_bobbin_per_trolly) + ? globalThis.Number(object.mc_bobbin_per_trolly) + : undefined, + mcBoxCost: isSet(object.mcBoxCost) + ? globalThis.Number(object.mcBoxCost) + : isSet(object.mc_box_cost) + ? globalThis.Number(object.mc_box_cost) + : undefined, + mcCaptivePerBobbin: isSet(object.mcCaptivePerBobbin) + ? globalThis.Number(object.mcCaptivePerBobbin) + : isSet(object.mc_captive_per_bobbin) + ? globalThis.Number(object.mc_captive_per_bobbin) + : undefined, + mcWeightage: isSet(object.mcWeightage) + ? globalThis.Number(object.mcWeightage) + : isSet(object.mc_weightage) + ? globalThis.Number(object.mc_weightage) + : undefined, + }; + }, + + toJSON(message: CreateMachineRequest): unknown { + const obj: any = {}; + if (message.machineCode !== "") { + obj.machineCode = message.machineCode; + } + if (message.machineName !== "") { + obj.machineName = message.machineName; + } + if (message.mcType !== "") { + obj.mcType = message.mcType; + } + if (message.mcLocation !== "") { + obj.mcLocation = message.mcLocation; + } + if (message.noOfPosition !== 0) { + obj.noOfPosition = Math.round(message.noOfPosition); + } + if (message.noOfEnd !== 0) { + obj.noOfEnd = Math.round(message.noOfEnd); + } + if (message.mcSpeed !== 0) { + obj.mcSpeed = message.mcSpeed; + } + if (message.machineRpm !== undefined) { + obj.machineRpm = message.machineRpm; + } + if (message.mcEfficiency !== 0) { + obj.mcEfficiency = message.mcEfficiency; + } + if (message.powerPerDay !== undefined) { + obj.powerPerDay = message.powerPerDay; + } + if (message.notes !== "") { + obj.notes = message.notes; + } + if (message.mpPerDay !== undefined) { + obj.mpPerDay = message.mpPerDay; + } + if (message.ohsPerDay !== undefined) { + obj.ohsPerDay = message.ohsPerDay; + } + if (message.sparesPerDay !== undefined) { + obj.sparesPerDay = message.sparesPerDay; + } + if (message.kgsLostChange !== undefined) { + obj.kgsLostChange = message.kgsLostChange; + } + if (message.vb1Qty !== undefined) { + obj.vb1Qty = message.vb1Qty; + } + if (message.vb2Qty !== undefined) { + obj.vb2Qty = message.vb2Qty; + } + if (message.vb3Qty !== undefined) { + obj.vb3Qty = message.vb3Qty; + } + if (message.vb4Qty !== undefined) { + obj.vb4Qty = message.vb4Qty; + } + if (message.vb5Qty !== undefined) { + obj.vb5Qty = message.vb5Qty; + } + if (message.mcPoyBobbinWeight !== undefined) { + obj.mcPoyBobbinWeight = message.mcPoyBobbinWeight; + } + if (message.mcTotFxdCst !== undefined) { + obj.mcTotFxdCst = message.mcTotFxdCst; + } + if (message.mcBobbinPerTrolly !== undefined) { + obj.mcBobbinPerTrolly = message.mcBobbinPerTrolly; + } + if (message.mcBoxCost !== undefined) { + obj.mcBoxCost = message.mcBoxCost; + } + if (message.mcCaptivePerBobbin !== undefined) { + obj.mcCaptivePerBobbin = message.mcCaptivePerBobbin; + } + if (message.mcWeightage !== undefined) { + obj.mcWeightage = message.mcWeightage; + } + return obj; + }, + + create(base?: DeepPartial): CreateMachineRequest { + return CreateMachineRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateMachineRequest { + const message = createBaseCreateMachineRequest(); + message.machineCode = object.machineCode ?? ""; + message.machineName = object.machineName ?? ""; + message.mcType = object.mcType ?? ""; + message.mcLocation = object.mcLocation ?? ""; + message.noOfPosition = object.noOfPosition ?? 0; + message.noOfEnd = object.noOfEnd ?? 0; + message.mcSpeed = object.mcSpeed ?? 0; + message.machineRpm = object.machineRpm ?? undefined; + message.mcEfficiency = object.mcEfficiency ?? 0; + message.powerPerDay = object.powerPerDay ?? undefined; + message.notes = object.notes ?? ""; + message.mpPerDay = object.mpPerDay ?? undefined; + message.ohsPerDay = object.ohsPerDay ?? undefined; + message.sparesPerDay = object.sparesPerDay ?? undefined; + message.kgsLostChange = object.kgsLostChange ?? undefined; + message.vb1Qty = object.vb1Qty ?? undefined; + message.vb2Qty = object.vb2Qty ?? undefined; + message.vb3Qty = object.vb3Qty ?? undefined; + message.vb4Qty = object.vb4Qty ?? undefined; + message.vb5Qty = object.vb5Qty ?? undefined; + message.mcPoyBobbinWeight = object.mcPoyBobbinWeight ?? undefined; + message.mcTotFxdCst = object.mcTotFxdCst ?? undefined; + message.mcBobbinPerTrolly = object.mcBobbinPerTrolly ?? undefined; + message.mcBoxCost = object.mcBoxCost ?? undefined; + message.mcCaptivePerBobbin = object.mcCaptivePerBobbin ?? undefined; + message.mcWeightage = object.mcWeightage ?? undefined; + return message; + }, +}; + +function createBaseCreateMachineResponse(): CreateMachineResponse { + return { base: undefined, data: undefined }; +} + +export const CreateMachineResponse: MessageFns = { + encode(message: CreateMachineResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + Machine.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateMachineResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMachineResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = Machine.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CreateMachineResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? Machine.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: CreateMachineResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = Machine.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): CreateMachineResponse { + return CreateMachineResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateMachineResponse { + const message = createBaseCreateMachineResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? Machine.fromPartial(object.data) : undefined; + return message; + }, +}; + +function createBaseGetMachineRequest(): GetMachineRequest { + return { machineId: "" }; +} + +export const GetMachineRequest: MessageFns = { + encode(message: GetMachineRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.machineId !== "") { + writer.uint32(10).string(message.machineId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetMachineRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetMachineRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.machineId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetMachineRequest { + return { + machineId: isSet(object.machineId) + ? globalThis.String(object.machineId) + : isSet(object.machine_id) + ? globalThis.String(object.machine_id) + : "", + }; + }, + + toJSON(message: GetMachineRequest): unknown { + const obj: any = {}; + if (message.machineId !== "") { + obj.machineId = message.machineId; + } + return obj; + }, + + create(base?: DeepPartial): GetMachineRequest { + return GetMachineRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetMachineRequest { + const message = createBaseGetMachineRequest(); + message.machineId = object.machineId ?? ""; + return message; + }, +}; + +function createBaseGetMachineResponse(): GetMachineResponse { + return { base: undefined, data: undefined }; +} + +export const GetMachineResponse: MessageFns = { + encode(message: GetMachineResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + Machine.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetMachineResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetMachineResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = Machine.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetMachineResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? Machine.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: GetMachineResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = Machine.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): GetMachineResponse { + return GetMachineResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetMachineResponse { + const message = createBaseGetMachineResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? Machine.fromPartial(object.data) : undefined; + return message; + }, +}; + +function createBaseUpdateMachineRequest(): UpdateMachineRequest { + return { + machineId: "", + machineName: undefined, + mcType: undefined, + mcLocation: undefined, + noOfPosition: undefined, + noOfEnd: undefined, + mcSpeed: undefined, + machineRpm: undefined, + mcEfficiency: undefined, + powerPerDay: undefined, + notes: undefined, + isActive: undefined, + mpPerDay: undefined, + ohsPerDay: undefined, + sparesPerDay: undefined, + kgsLostChange: undefined, + vb1Qty: undefined, + vb2Qty: undefined, + vb3Qty: undefined, + vb4Qty: undefined, + vb5Qty: undefined, + mcPoyBobbinWeight: undefined, + mcTotFxdCst: undefined, + mcBobbinPerTrolly: undefined, + mcBoxCost: undefined, + mcCaptivePerBobbin: undefined, + mcWeightage: undefined, + }; +} + +export const UpdateMachineRequest: MessageFns = { + encode(message: UpdateMachineRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.machineId !== "") { + writer.uint32(10).string(message.machineId); + } + if (message.machineName !== undefined) { + writer.uint32(18).string(message.machineName); + } + if (message.mcType !== undefined) { + writer.uint32(26).string(message.mcType); + } + if (message.mcLocation !== undefined) { + writer.uint32(34).string(message.mcLocation); + } + if (message.noOfPosition !== undefined) { + writer.uint32(40).int32(message.noOfPosition); + } + if (message.noOfEnd !== undefined) { + writer.uint32(48).int32(message.noOfEnd); + } + if (message.mcSpeed !== undefined) { + writer.uint32(57).double(message.mcSpeed); + } + if (message.machineRpm !== undefined) { + writer.uint32(65).double(message.machineRpm); + } + if (message.mcEfficiency !== undefined) { + writer.uint32(73).double(message.mcEfficiency); + } + if (message.powerPerDay !== undefined) { + writer.uint32(81).double(message.powerPerDay); + } + if (message.notes !== undefined) { + writer.uint32(90).string(message.notes); + } + if (message.isActive !== undefined) { + writer.uint32(96).bool(message.isActive); + } + if (message.mpPerDay !== undefined) { + writer.uint32(105).double(message.mpPerDay); + } + if (message.ohsPerDay !== undefined) { + writer.uint32(113).double(message.ohsPerDay); + } + if (message.sparesPerDay !== undefined) { + writer.uint32(121).double(message.sparesPerDay); + } + if (message.kgsLostChange !== undefined) { + writer.uint32(129).double(message.kgsLostChange); + } + if (message.vb1Qty !== undefined) { + writer.uint32(137).double(message.vb1Qty); + } + if (message.vb2Qty !== undefined) { + writer.uint32(145).double(message.vb2Qty); + } + if (message.vb3Qty !== undefined) { + writer.uint32(153).double(message.vb3Qty); + } + if (message.vb4Qty !== undefined) { + writer.uint32(161).double(message.vb4Qty); + } + if (message.vb5Qty !== undefined) { + writer.uint32(169).double(message.vb5Qty); + } + if (message.mcPoyBobbinWeight !== undefined) { + writer.uint32(177).double(message.mcPoyBobbinWeight); + } + if (message.mcTotFxdCst !== undefined) { + writer.uint32(185).double(message.mcTotFxdCst); + } + if (message.mcBobbinPerTrolly !== undefined) { + writer.uint32(193).double(message.mcBobbinPerTrolly); + } + if (message.mcBoxCost !== undefined) { + writer.uint32(201).double(message.mcBoxCost); + } + if (message.mcCaptivePerBobbin !== undefined) { + writer.uint32(209).double(message.mcCaptivePerBobbin); + } + if (message.mcWeightage !== undefined) { + writer.uint32(217).double(message.mcWeightage); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMachineRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateMachineRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.machineId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.machineName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.mcType = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.mcLocation = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.noOfPosition = reader.int32(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.noOfEnd = reader.int32(); + continue; + } + case 7: { + if (tag !== 57) { + break; + } + + message.mcSpeed = reader.double(); + continue; + } + case 8: { + if (tag !== 65) { + break; + } + + message.machineRpm = reader.double(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.mcEfficiency = reader.double(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.powerPerDay = reader.double(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.notes = reader.string(); + continue; + } + case 12: { + if (tag !== 96) { + break; + } + + message.isActive = reader.bool(); + continue; + } + case 13: { + if (tag !== 105) { + break; + } + + message.mpPerDay = reader.double(); + continue; + } + case 14: { + if (tag !== 113) { + break; + } + + message.ohsPerDay = reader.double(); + continue; + } + case 15: { + if (tag !== 121) { + break; + } + + message.sparesPerDay = reader.double(); + continue; + } + case 16: { + if (tag !== 129) { + break; + } + + message.kgsLostChange = reader.double(); + continue; + } + case 17: { + if (tag !== 137) { + break; + } + + message.vb1Qty = reader.double(); + continue; + } + case 18: { + if (tag !== 145) { + break; + } + + message.vb2Qty = reader.double(); + continue; + } + case 19: { + if (tag !== 153) { + break; + } + + message.vb3Qty = reader.double(); + continue; + } + case 20: { + if (tag !== 161) { + break; + } + + message.vb4Qty = reader.double(); + continue; + } + case 21: { + if (tag !== 169) { + break; + } + + message.vb5Qty = reader.double(); + continue; + } + case 22: { + if (tag !== 177) { + break; + } + + message.mcPoyBobbinWeight = reader.double(); + continue; + } + case 23: { + if (tag !== 185) { + break; + } + + message.mcTotFxdCst = reader.double(); + continue; + } + case 24: { + if (tag !== 193) { + break; + } + + message.mcBobbinPerTrolly = reader.double(); + continue; + } + case 25: { + if (tag !== 201) { + break; + } + + message.mcBoxCost = reader.double(); + continue; + } + case 26: { + if (tag !== 209) { + break; + } + + message.mcCaptivePerBobbin = reader.double(); + continue; + } + case 27: { + if (tag !== 217) { + break; + } + + message.mcWeightage = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateMachineRequest { + return { + machineId: isSet(object.machineId) + ? globalThis.String(object.machineId) + : isSet(object.machine_id) + ? globalThis.String(object.machine_id) + : "", + machineName: isSet(object.machineName) + ? globalThis.String(object.machineName) + : isSet(object.machine_name) + ? globalThis.String(object.machine_name) + : undefined, + mcType: isSet(object.mcType) + ? globalThis.String(object.mcType) + : isSet(object.mc_type) + ? globalThis.String(object.mc_type) + : undefined, + mcLocation: isSet(object.mcLocation) + ? globalThis.String(object.mcLocation) + : isSet(object.mc_location) + ? globalThis.String(object.mc_location) + : undefined, + noOfPosition: isSet(object.noOfPosition) + ? globalThis.Number(object.noOfPosition) + : isSet(object.no_of_position) + ? globalThis.Number(object.no_of_position) + : undefined, + noOfEnd: isSet(object.noOfEnd) + ? globalThis.Number(object.noOfEnd) + : isSet(object.no_of_end) + ? globalThis.Number(object.no_of_end) + : undefined, + mcSpeed: isSet(object.mcSpeed) + ? globalThis.Number(object.mcSpeed) + : isSet(object.mc_speed) + ? globalThis.Number(object.mc_speed) + : undefined, + machineRpm: isSet(object.machineRpm) + ? globalThis.Number(object.machineRpm) + : isSet(object.machine_rpm) + ? globalThis.Number(object.machine_rpm) + : undefined, + mcEfficiency: isSet(object.mcEfficiency) + ? globalThis.Number(object.mcEfficiency) + : isSet(object.mc_efficiency) + ? globalThis.Number(object.mc_efficiency) + : undefined, + powerPerDay: isSet(object.powerPerDay) + ? globalThis.Number(object.powerPerDay) + : isSet(object.power_per_day) + ? globalThis.Number(object.power_per_day) + : undefined, + notes: isSet(object.notes) ? globalThis.String(object.notes) : undefined, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : undefined, + mpPerDay: isSet(object.mpPerDay) + ? globalThis.Number(object.mpPerDay) + : isSet(object.mp_per_day) + ? globalThis.Number(object.mp_per_day) + : undefined, + ohsPerDay: isSet(object.ohsPerDay) + ? globalThis.Number(object.ohsPerDay) + : isSet(object.ohs_per_day) + ? globalThis.Number(object.ohs_per_day) + : undefined, + sparesPerDay: isSet(object.sparesPerDay) + ? globalThis.Number(object.sparesPerDay) + : isSet(object.spares_per_day) + ? globalThis.Number(object.spares_per_day) + : undefined, + kgsLostChange: isSet(object.kgsLostChange) + ? globalThis.Number(object.kgsLostChange) + : isSet(object.kgs_lost_change) + ? globalThis.Number(object.kgs_lost_change) + : undefined, + vb1Qty: isSet(object.vb1Qty) + ? globalThis.Number(object.vb1Qty) + : isSet(object.vb1_qty) + ? globalThis.Number(object.vb1_qty) + : undefined, + vb2Qty: isSet(object.vb2Qty) + ? globalThis.Number(object.vb2Qty) + : isSet(object.vb2_qty) + ? globalThis.Number(object.vb2_qty) + : undefined, + vb3Qty: isSet(object.vb3Qty) + ? globalThis.Number(object.vb3Qty) + : isSet(object.vb3_qty) + ? globalThis.Number(object.vb3_qty) + : undefined, + vb4Qty: isSet(object.vb4Qty) + ? globalThis.Number(object.vb4Qty) + : isSet(object.vb4_qty) + ? globalThis.Number(object.vb4_qty) + : undefined, + vb5Qty: isSet(object.vb5Qty) + ? globalThis.Number(object.vb5Qty) + : isSet(object.vb5_qty) + ? globalThis.Number(object.vb5_qty) + : undefined, + mcPoyBobbinWeight: isSet(object.mcPoyBobbinWeight) + ? globalThis.Number(object.mcPoyBobbinWeight) + : isSet(object.mc_poy_bobbin_weight) + ? globalThis.Number(object.mc_poy_bobbin_weight) + : undefined, + mcTotFxdCst: isSet(object.mcTotFxdCst) + ? globalThis.Number(object.mcTotFxdCst) + : isSet(object.mc_tot_fxd_cst) + ? globalThis.Number(object.mc_tot_fxd_cst) + : undefined, + mcBobbinPerTrolly: isSet(object.mcBobbinPerTrolly) + ? globalThis.Number(object.mcBobbinPerTrolly) + : isSet(object.mc_bobbin_per_trolly) + ? globalThis.Number(object.mc_bobbin_per_trolly) + : undefined, + mcBoxCost: isSet(object.mcBoxCost) + ? globalThis.Number(object.mcBoxCost) + : isSet(object.mc_box_cost) + ? globalThis.Number(object.mc_box_cost) + : undefined, + mcCaptivePerBobbin: isSet(object.mcCaptivePerBobbin) + ? globalThis.Number(object.mcCaptivePerBobbin) + : isSet(object.mc_captive_per_bobbin) + ? globalThis.Number(object.mc_captive_per_bobbin) + : undefined, + mcWeightage: isSet(object.mcWeightage) + ? globalThis.Number(object.mcWeightage) + : isSet(object.mc_weightage) + ? globalThis.Number(object.mc_weightage) + : undefined, + }; + }, + + toJSON(message: UpdateMachineRequest): unknown { + const obj: any = {}; + if (message.machineId !== "") { + obj.machineId = message.machineId; + } + if (message.machineName !== undefined) { + obj.machineName = message.machineName; + } + if (message.mcType !== undefined) { + obj.mcType = message.mcType; + } + if (message.mcLocation !== undefined) { + obj.mcLocation = message.mcLocation; + } + if (message.noOfPosition !== undefined) { + obj.noOfPosition = Math.round(message.noOfPosition); + } + if (message.noOfEnd !== undefined) { + obj.noOfEnd = Math.round(message.noOfEnd); + } + if (message.mcSpeed !== undefined) { + obj.mcSpeed = message.mcSpeed; + } + if (message.machineRpm !== undefined) { + obj.machineRpm = message.machineRpm; + } + if (message.mcEfficiency !== undefined) { + obj.mcEfficiency = message.mcEfficiency; + } + if (message.powerPerDay !== undefined) { + obj.powerPerDay = message.powerPerDay; + } + if (message.notes !== undefined) { + obj.notes = message.notes; + } + if (message.isActive !== undefined) { + obj.isActive = message.isActive; + } + if (message.mpPerDay !== undefined) { + obj.mpPerDay = message.mpPerDay; + } + if (message.ohsPerDay !== undefined) { + obj.ohsPerDay = message.ohsPerDay; + } + if (message.sparesPerDay !== undefined) { + obj.sparesPerDay = message.sparesPerDay; + } + if (message.kgsLostChange !== undefined) { + obj.kgsLostChange = message.kgsLostChange; + } + if (message.vb1Qty !== undefined) { + obj.vb1Qty = message.vb1Qty; + } + if (message.vb2Qty !== undefined) { + obj.vb2Qty = message.vb2Qty; + } + if (message.vb3Qty !== undefined) { + obj.vb3Qty = message.vb3Qty; + } + if (message.vb4Qty !== undefined) { + obj.vb4Qty = message.vb4Qty; + } + if (message.vb5Qty !== undefined) { + obj.vb5Qty = message.vb5Qty; + } + if (message.mcPoyBobbinWeight !== undefined) { + obj.mcPoyBobbinWeight = message.mcPoyBobbinWeight; + } + if (message.mcTotFxdCst !== undefined) { + obj.mcTotFxdCst = message.mcTotFxdCst; + } + if (message.mcBobbinPerTrolly !== undefined) { + obj.mcBobbinPerTrolly = message.mcBobbinPerTrolly; + } + if (message.mcBoxCost !== undefined) { + obj.mcBoxCost = message.mcBoxCost; + } + if (message.mcCaptivePerBobbin !== undefined) { + obj.mcCaptivePerBobbin = message.mcCaptivePerBobbin; + } + if (message.mcWeightage !== undefined) { + obj.mcWeightage = message.mcWeightage; + } + return obj; + }, + + create(base?: DeepPartial): UpdateMachineRequest { + return UpdateMachineRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateMachineRequest { + const message = createBaseUpdateMachineRequest(); + message.machineId = object.machineId ?? ""; + message.machineName = object.machineName ?? undefined; + message.mcType = object.mcType ?? undefined; + message.mcLocation = object.mcLocation ?? undefined; + message.noOfPosition = object.noOfPosition ?? undefined; + message.noOfEnd = object.noOfEnd ?? undefined; + message.mcSpeed = object.mcSpeed ?? undefined; + message.machineRpm = object.machineRpm ?? undefined; + message.mcEfficiency = object.mcEfficiency ?? undefined; + message.powerPerDay = object.powerPerDay ?? undefined; + message.notes = object.notes ?? undefined; + message.isActive = object.isActive ?? undefined; + message.mpPerDay = object.mpPerDay ?? undefined; + message.ohsPerDay = object.ohsPerDay ?? undefined; + message.sparesPerDay = object.sparesPerDay ?? undefined; + message.kgsLostChange = object.kgsLostChange ?? undefined; + message.vb1Qty = object.vb1Qty ?? undefined; + message.vb2Qty = object.vb2Qty ?? undefined; + message.vb3Qty = object.vb3Qty ?? undefined; + message.vb4Qty = object.vb4Qty ?? undefined; + message.vb5Qty = object.vb5Qty ?? undefined; + message.mcPoyBobbinWeight = object.mcPoyBobbinWeight ?? undefined; + message.mcTotFxdCst = object.mcTotFxdCst ?? undefined; + message.mcBobbinPerTrolly = object.mcBobbinPerTrolly ?? undefined; + message.mcBoxCost = object.mcBoxCost ?? undefined; + message.mcCaptivePerBobbin = object.mcCaptivePerBobbin ?? undefined; + message.mcWeightage = object.mcWeightage ?? undefined; + return message; + }, +}; + +function createBaseUpdateMachineResponse(): UpdateMachineResponse { + return { base: undefined, data: undefined }; +} + +export const UpdateMachineResponse: MessageFns = { + encode(message: UpdateMachineResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + Machine.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMachineResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateMachineResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = Machine.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateMachineResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? Machine.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: UpdateMachineResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = Machine.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): UpdateMachineResponse { + return UpdateMachineResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateMachineResponse { + const message = createBaseUpdateMachineResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? Machine.fromPartial(object.data) : undefined; + return message; + }, +}; + +function createBaseDeleteMachineRequest(): DeleteMachineRequest { + return { machineId: "" }; +} + +export const DeleteMachineRequest: MessageFns = { + encode(message: DeleteMachineRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.machineId !== "") { + writer.uint32(10).string(message.machineId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMachineRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteMachineRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.machineId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteMachineRequest { + return { + machineId: isSet(object.machineId) + ? globalThis.String(object.machineId) + : isSet(object.machine_id) + ? globalThis.String(object.machine_id) + : "", + }; + }, + + toJSON(message: DeleteMachineRequest): unknown { + const obj: any = {}; + if (message.machineId !== "") { + obj.machineId = message.machineId; + } + return obj; + }, + + create(base?: DeepPartial): DeleteMachineRequest { + return DeleteMachineRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteMachineRequest { + const message = createBaseDeleteMachineRequest(); + message.machineId = object.machineId ?? ""; + return message; + }, +}; + +function createBaseDeleteMachineResponse(): DeleteMachineResponse { + return { base: undefined }; +} + +export const DeleteMachineResponse: MessageFns = { + encode(message: DeleteMachineResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMachineResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteMachineResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteMachineResponse { + return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; + }, + + toJSON(message: DeleteMachineResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + return obj; + }, + + create(base?: DeepPartial): DeleteMachineResponse { + return DeleteMachineResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteMachineResponse { + const message = createBaseDeleteMachineResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + return message; + }, +}; + +function createBaseListMachinesRequest(): ListMachinesRequest { + return { page: 0, pageSize: 0, search: "", mcTypeFilter: "", activeFilter: 0, sortBy: "", sortOrder: "" }; +} + +export const ListMachinesRequest: MessageFns = { + encode(message: ListMachinesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.page !== 0) { + writer.uint32(8).int32(message.page); + } + if (message.pageSize !== 0) { + writer.uint32(16).int32(message.pageSize); + } + if (message.search !== "") { + writer.uint32(26).string(message.search); + } + if (message.mcTypeFilter !== "") { + writer.uint32(34).string(message.mcTypeFilter); + } + if (message.activeFilter !== 0) { + writer.uint32(40).int32(message.activeFilter); + } + if (message.sortBy !== "") { + writer.uint32(50).string(message.sortBy); + } + if (message.sortOrder !== "") { + writer.uint32(58).string(message.sortOrder); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListMachinesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListMachinesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.page = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.pageSize = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.search = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.mcTypeFilter = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.activeFilter = reader.int32() as any; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.sortBy = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.sortOrder = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListMachinesRequest { + return { + page: isSet(object.page) ? globalThis.Number(object.page) : 0, + pageSize: isSet(object.pageSize) + ? globalThis.Number(object.pageSize) + : isSet(object.page_size) + ? globalThis.Number(object.page_size) + : 0, + search: isSet(object.search) ? globalThis.String(object.search) : "", + mcTypeFilter: isSet(object.mcTypeFilter) + ? globalThis.String(object.mcTypeFilter) + : isSet(object.mc_type_filter) + ? globalThis.String(object.mc_type_filter) + : "", + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, + sortBy: isSet(object.sortBy) + ? globalThis.String(object.sortBy) + : isSet(object.sort_by) + ? globalThis.String(object.sort_by) + : "", + sortOrder: isSet(object.sortOrder) + ? globalThis.String(object.sortOrder) + : isSet(object.sort_order) + ? globalThis.String(object.sort_order) + : "", + }; + }, + + toJSON(message: ListMachinesRequest): unknown { + const obj: any = {}; + if (message.page !== 0) { + obj.page = Math.round(message.page); + } + if (message.pageSize !== 0) { + obj.pageSize = Math.round(message.pageSize); + } + if (message.search !== "") { + obj.search = message.search; + } + if (message.mcTypeFilter !== "") { + obj.mcTypeFilter = message.mcTypeFilter; + } + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); + } + if (message.sortBy !== "") { + obj.sortBy = message.sortBy; + } + if (message.sortOrder !== "") { + obj.sortOrder = message.sortOrder; + } + return obj; + }, + + create(base?: DeepPartial): ListMachinesRequest { + return ListMachinesRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListMachinesRequest { + const message = createBaseListMachinesRequest(); + message.page = object.page ?? 0; + message.pageSize = object.pageSize ?? 0; + message.search = object.search ?? ""; + message.mcTypeFilter = object.mcTypeFilter ?? ""; + message.activeFilter = object.activeFilter ?? 0; + message.sortBy = object.sortBy ?? ""; + message.sortOrder = object.sortOrder ?? ""; + return message; + }, +}; + +function createBaseListMachinesResponse(): ListMachinesResponse { + return { base: undefined, data: [], pagination: undefined }; +} + +export const ListMachinesResponse: MessageFns = { + encode(message: ListMachinesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + for (const v of message.data) { + Machine.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.pagination !== undefined) { + PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListMachinesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListMachinesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data.push(Machine.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pagination = PaginationResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListMachinesResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => Machine.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: ListMachinesResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data?.length) { + obj.data = message.data.map((e) => Machine.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PaginationResponse.toJSON(message.pagination); + } + return obj; + }, + + create(base?: DeepPartial): ListMachinesResponse { + return ListMachinesResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListMachinesResponse { + const message = createBaseListMachinesResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = object.data?.map((e) => Machine.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PaginationResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseExportMachinesRequest(): ExportMachinesRequest { + return { activeFilter: 0 }; +} + +export const ExportMachinesRequest: MessageFns = { + encode(message: ExportMachinesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.activeFilter !== 0) { + writer.uint32(8).int32(message.activeFilter); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExportMachinesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExportMachinesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.activeFilter = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExportMachinesRequest { + return { + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, + }; + }, + + toJSON(message: ExportMachinesRequest): unknown { + const obj: any = {}; + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); + } + return obj; + }, + + create(base?: DeepPartial): ExportMachinesRequest { + return ExportMachinesRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExportMachinesRequest { + const message = createBaseExportMachinesRequest(); + message.activeFilter = object.activeFilter ?? 0; + return message; + }, +}; + +function createBaseExportMachinesResponse(): ExportMachinesResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +} + +export const ExportMachinesResponse: MessageFns = { + encode(message: ExportMachinesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExportMachinesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExportMachinesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExportMachinesResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + }; + }, + + toJSON(message: ExportMachinesResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + return obj; + }, + + create(base?: DeepPartial): ExportMachinesResponse { + return ExportMachinesResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExportMachinesResponse { + const message = createBaseExportMachinesResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + return message; + }, +}; + +function createBaseImportMachinesRequest(): ImportMachinesRequest { + return { fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; +} + +export const ImportMachinesRequest: MessageFns = { + encode(message: ImportMachinesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.fileContent.length !== 0) { + writer.uint32(10).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(18).string(message.fileName); + } + if (message.duplicateAction !== "") { + writer.uint32(26).string(message.duplicateAction); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ImportMachinesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseImportMachinesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.duplicateAction = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ImportMachinesRequest { + return { + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + duplicateAction: isSet(object.duplicateAction) + ? globalThis.String(object.duplicateAction) + : isSet(object.duplicate_action) + ? globalThis.String(object.duplicate_action) + : "", + }; + }, + + toJSON(message: ImportMachinesRequest): unknown { + const obj: any = {}; + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + if (message.duplicateAction !== "") { + obj.duplicateAction = message.duplicateAction; + } + return obj; + }, + + create(base?: DeepPartial): ImportMachinesRequest { + return ImportMachinesRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ImportMachinesRequest { + const message = createBaseImportMachinesRequest(); + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + message.duplicateAction = object.duplicateAction ?? ""; + return message; + }, +}; + +function createBaseImportMachinesResponse(): ImportMachinesResponse { + return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; +} + +export const ImportMachinesResponse: MessageFns = { + encode(message: ImportMachinesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.successCount !== 0) { + writer.uint32(16).int32(message.successCount); + } + if (message.skippedCount !== 0) { + writer.uint32(24).int32(message.skippedCount); + } + if (message.failedCount !== 0) { + writer.uint32(32).int32(message.failedCount); + } + for (const v of message.errors) { + ImportError.encode(v!, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ImportMachinesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseImportMachinesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.successCount = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.skippedCount = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.failedCount = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.errors.push(ImportError.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ImportMachinesResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + successCount: isSet(object.successCount) + ? globalThis.Number(object.successCount) + : isSet(object.success_count) + ? globalThis.Number(object.success_count) + : 0, + skippedCount: isSet(object.skippedCount) + ? globalThis.Number(object.skippedCount) + : isSet(object.skipped_count) + ? globalThis.Number(object.skipped_count) + : 0, + failedCount: isSet(object.failedCount) + ? globalThis.Number(object.failedCount) + : isSet(object.failed_count) + ? globalThis.Number(object.failed_count) + : 0, + errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => ImportError.fromJSON(e)) : [], + }; + }, + + toJSON(message: ImportMachinesResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.successCount !== 0) { + obj.successCount = Math.round(message.successCount); + } + if (message.skippedCount !== 0) { + obj.skippedCount = Math.round(message.skippedCount); + } + if (message.failedCount !== 0) { + obj.failedCount = Math.round(message.failedCount); + } + if (message.errors?.length) { + obj.errors = message.errors.map((e) => ImportError.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ImportMachinesResponse { + return ImportMachinesResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ImportMachinesResponse { + const message = createBaseImportMachinesResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.successCount = object.successCount ?? 0; + message.skippedCount = object.skippedCount ?? 0; + message.failedCount = object.failedCount ?? 0; + message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDownloadMachineTemplateRequest(): DownloadMachineTemplateRequest { + return {}; +} + +export const DownloadMachineTemplateRequest: MessageFns = { + encode(_: DownloadMachineTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DownloadMachineTemplateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDownloadMachineTemplateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): DownloadMachineTemplateRequest { + return {}; + }, + + toJSON(_: DownloadMachineTemplateRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): DownloadMachineTemplateRequest { + return DownloadMachineTemplateRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): DownloadMachineTemplateRequest { + const message = createBaseDownloadMachineTemplateRequest(); + return message; + }, +}; + +function createBaseDownloadMachineTemplateResponse(): DownloadMachineTemplateResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +} + +export const DownloadMachineTemplateResponse: MessageFns = { + encode(message: DownloadMachineTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DownloadMachineTemplateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDownloadMachineTemplateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DownloadMachineTemplateResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + }; + }, + + toJSON(message: DownloadMachineTemplateResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + return obj; + }, + + create(base?: DeepPartial): DownloadMachineTemplateResponse { + return DownloadMachineTemplateResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DownloadMachineTemplateResponse { + const message = createBaseDownloadMachineTemplateResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + return message; + }, +}; + +function createBaseBoxBobbinCostRate(): BoxBobbinCostRate { + return { + bbcrId: "", + bbcrBbcId: "", + bbcrPeriod: "", + bbcrBobRateMkt: 0, + bbcrBoxRateMkt: 0, + bbcrBobRateVal: undefined, + bbcrBoxRateVal: undefined, + audit: undefined, + }; +} + +export const BoxBobbinCostRate: MessageFns = { + encode(message: BoxBobbinCostRate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bbcrId !== "") { + writer.uint32(10).string(message.bbcrId); + } + if (message.bbcrBbcId !== "") { + writer.uint32(18).string(message.bbcrBbcId); + } + if (message.bbcrPeriod !== "") { + writer.uint32(26).string(message.bbcrPeriod); + } + if (message.bbcrBobRateMkt !== 0) { + writer.uint32(33).double(message.bbcrBobRateMkt); + } + if (message.bbcrBoxRateMkt !== 0) { + writer.uint32(41).double(message.bbcrBoxRateMkt); + } + if (message.bbcrBobRateVal !== undefined) { + writer.uint32(49).double(message.bbcrBobRateVal); + } + if (message.bbcrBoxRateVal !== undefined) { + writer.uint32(57).double(message.bbcrBoxRateVal); + } + if (message.audit !== undefined) { + AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BoxBobbinCostRate { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBoxBobbinCostRate(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bbcrId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bbcrBbcId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.bbcrPeriod = reader.string(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.bbcrBobRateMkt = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.bbcrBoxRateMkt = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.bbcrBobRateVal = reader.double(); + continue; + } + case 7: { + if (tag !== 57) { + break; + } + + message.bbcrBoxRateVal = reader.double(); + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.audit = AuditInfo.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BoxBobbinCostRate { + return { + bbcrId: isSet(object.bbcrId) + ? globalThis.String(object.bbcrId) + : isSet(object.bbcr_id) + ? globalThis.String(object.bbcr_id) + : "", + bbcrBbcId: isSet(object.bbcrBbcId) + ? globalThis.String(object.bbcrBbcId) + : isSet(object.bbcr_bbc_id) + ? globalThis.String(object.bbcr_bbc_id) + : "", + bbcrPeriod: isSet(object.bbcrPeriod) + ? globalThis.String(object.bbcrPeriod) + : isSet(object.bbcr_period) + ? globalThis.String(object.bbcr_period) + : "", + bbcrBobRateMkt: isSet(object.bbcrBobRateMkt) + ? globalThis.Number(object.bbcrBobRateMkt) + : isSet(object.bbcr_bob_rate_mkt) + ? globalThis.Number(object.bbcr_bob_rate_mkt) + : 0, + bbcrBoxRateMkt: isSet(object.bbcrBoxRateMkt) + ? globalThis.Number(object.bbcrBoxRateMkt) + : isSet(object.bbcr_box_rate_mkt) + ? globalThis.Number(object.bbcr_box_rate_mkt) + : 0, + bbcrBobRateVal: isSet(object.bbcrBobRateVal) + ? globalThis.Number(object.bbcrBobRateVal) + : isSet(object.bbcr_bob_rate_val) + ? globalThis.Number(object.bbcr_bob_rate_val) + : undefined, + bbcrBoxRateVal: isSet(object.bbcrBoxRateVal) + ? globalThis.Number(object.bbcrBoxRateVal) + : isSet(object.bbcr_box_rate_val) + ? globalThis.Number(object.bbcr_box_rate_val) + : undefined, + audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, + }; + }, + + toJSON(message: BoxBobbinCostRate): unknown { + const obj: any = {}; + if (message.bbcrId !== "") { + obj.bbcrId = message.bbcrId; + } + if (message.bbcrBbcId !== "") { + obj.bbcrBbcId = message.bbcrBbcId; + } + if (message.bbcrPeriod !== "") { + obj.bbcrPeriod = message.bbcrPeriod; + } + if (message.bbcrBobRateMkt !== 0) { + obj.bbcrBobRateMkt = message.bbcrBobRateMkt; + } + if (message.bbcrBoxRateMkt !== 0) { + obj.bbcrBoxRateMkt = message.bbcrBoxRateMkt; + } + if (message.bbcrBobRateVal !== undefined) { + obj.bbcrBobRateVal = message.bbcrBobRateVal; + } + if (message.bbcrBoxRateVal !== undefined) { + obj.bbcrBoxRateVal = message.bbcrBoxRateVal; + } + if (message.audit !== undefined) { + obj.audit = AuditInfo.toJSON(message.audit); + } + return obj; + }, + + create(base?: DeepPartial): BoxBobbinCostRate { + return BoxBobbinCostRate.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BoxBobbinCostRate { + const message = createBaseBoxBobbinCostRate(); + message.bbcrId = object.bbcrId ?? ""; + message.bbcrBbcId = object.bbcrBbcId ?? ""; + message.bbcrPeriod = object.bbcrPeriod ?? ""; + message.bbcrBobRateMkt = object.bbcrBobRateMkt ?? 0; + message.bbcrBoxRateMkt = object.bbcrBoxRateMkt ?? 0; + message.bbcrBobRateVal = object.bbcrBobRateVal ?? undefined; + message.bbcrBoxRateVal = object.bbcrBoxRateVal ?? undefined; + message.audit = (object.audit !== undefined && object.audit !== null) + ? AuditInfo.fromPartial(object.audit) + : undefined; + return message; + }, +}; + +function createBaseBoxBobbinCost(): BoxBobbinCost { + return { + bbcId: "", + bbcCode: "", + bbcName: "", + bbcType: "", + noOfBob: 0, + isActive: false, + notes: "", + rates: [], + bbnReuse: undefined, + boxReuse: undefined, + boxCost: undefined, + bobinCost: undefined, + boxCostVal: undefined, + bobinCostVal: undefined, + bbnReuseVal: undefined, + audit: undefined, + boxReuseVal: undefined, + }; +} + +export const BoxBobbinCost: MessageFns = { + encode(message: BoxBobbinCost, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bbcId !== "") { + writer.uint32(10).string(message.bbcId); + } + if (message.bbcCode !== "") { + writer.uint32(18).string(message.bbcCode); + } + if (message.bbcName !== "") { + writer.uint32(26).string(message.bbcName); + } + if (message.bbcType !== "") { + writer.uint32(34).string(message.bbcType); + } + if (message.noOfBob !== 0) { + writer.uint32(40).int32(message.noOfBob); + } + if (message.isActive !== false) { + writer.uint32(48).bool(message.isActive); + } + if (message.notes !== "") { + writer.uint32(58).string(message.notes); + } + for (const v of message.rates) { + BoxBobbinCostRate.encode(v!, writer.uint32(66).fork()).join(); + } + if (message.bbnReuse !== undefined) { + writer.uint32(73).double(message.bbnReuse); + } + if (message.boxReuse !== undefined) { + writer.uint32(81).double(message.boxReuse); + } + if (message.boxCost !== undefined) { + writer.uint32(89).double(message.boxCost); + } + if (message.bobinCost !== undefined) { + writer.uint32(97).double(message.bobinCost); + } + if (message.boxCostVal !== undefined) { + writer.uint32(105).double(message.boxCostVal); + } + if (message.bobinCostVal !== undefined) { + writer.uint32(113).double(message.bobinCostVal); + } + if (message.bbnReuseVal !== undefined) { + writer.uint32(121).double(message.bbnReuseVal); + } + if (message.audit !== undefined) { + AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); + } + if (message.boxReuseVal !== undefined) { + writer.uint32(137).double(message.boxReuseVal); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): BoxBobbinCost { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseBoxBobbinCost(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bbcId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bbcCode = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.bbcName = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.bbcType = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.noOfBob = reader.int32(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.isActive = reader.bool(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.notes = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.rates.push(BoxBobbinCostRate.decode(reader, reader.uint32())); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.bbnReuse = reader.double(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.boxReuse = reader.double(); + continue; + } + case 11: { + if (tag !== 89) { + break; + } + + message.boxCost = reader.double(); + continue; + } + case 12: { + if (tag !== 97) { + break; + } + + message.bobinCost = reader.double(); + continue; + } + case 13: { + if (tag !== 105) { + break; + } + + message.boxCostVal = reader.double(); + continue; + } + case 14: { + if (tag !== 113) { + break; + } + + message.bobinCostVal = reader.double(); + continue; + } + case 15: { + if (tag !== 121) { + break; + } + + message.bbnReuseVal = reader.double(); + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.audit = AuditInfo.decode(reader, reader.uint32()); + continue; + } + case 17: { + if (tag !== 137) { + break; + } + + message.boxReuseVal = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): BoxBobbinCost { + return { + bbcId: isSet(object.bbcId) + ? globalThis.String(object.bbcId) + : isSet(object.bbc_id) + ? globalThis.String(object.bbc_id) + : "", + bbcCode: isSet(object.bbcCode) + ? globalThis.String(object.bbcCode) + : isSet(object.bbc_code) + ? globalThis.String(object.bbc_code) + : "", + bbcName: isSet(object.bbcName) + ? globalThis.String(object.bbcName) + : isSet(object.bbc_name) + ? globalThis.String(object.bbc_name) + : "", + bbcType: isSet(object.bbcType) + ? globalThis.String(object.bbcType) + : isSet(object.bbc_type) + ? globalThis.String(object.bbc_type) + : "", + noOfBob: isSet(object.noOfBob) + ? globalThis.Number(object.noOfBob) + : isSet(object.no_of_bob) + ? globalThis.Number(object.no_of_bob) + : 0, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, + notes: isSet(object.notes) ? globalThis.String(object.notes) : "", + rates: globalThis.Array.isArray(object?.rates) + ? object.rates.map((e: any) => BoxBobbinCostRate.fromJSON(e)) + : [], + bbnReuse: isSet(object.bbnReuse) + ? globalThis.Number(object.bbnReuse) + : isSet(object.bbn_reuse) + ? globalThis.Number(object.bbn_reuse) + : undefined, + boxReuse: isSet(object.boxReuse) + ? globalThis.Number(object.boxReuse) + : isSet(object.box_reuse) + ? globalThis.Number(object.box_reuse) + : undefined, + boxCost: isSet(object.boxCost) + ? globalThis.Number(object.boxCost) + : isSet(object.box_cost) + ? globalThis.Number(object.box_cost) + : undefined, + bobinCost: isSet(object.bobinCost) + ? globalThis.Number(object.bobinCost) + : isSet(object.bobin_cost) + ? globalThis.Number(object.bobin_cost) + : undefined, + boxCostVal: isSet(object.boxCostVal) + ? globalThis.Number(object.boxCostVal) + : isSet(object.box_cost_val) + ? globalThis.Number(object.box_cost_val) + : undefined, + bobinCostVal: isSet(object.bobinCostVal) + ? globalThis.Number(object.bobinCostVal) + : isSet(object.bobin_cost_val) + ? globalThis.Number(object.bobin_cost_val) + : undefined, + bbnReuseVal: isSet(object.bbnReuseVal) + ? globalThis.Number(object.bbnReuseVal) + : isSet(object.bbn_reuse_val) + ? globalThis.Number(object.bbn_reuse_val) + : undefined, + audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, + boxReuseVal: isSet(object.boxReuseVal) + ? globalThis.Number(object.boxReuseVal) + : isSet(object.box_reuse_val) + ? globalThis.Number(object.box_reuse_val) + : undefined, + }; + }, + + toJSON(message: BoxBobbinCost): unknown { + const obj: any = {}; + if (message.bbcId !== "") { + obj.bbcId = message.bbcId; + } + if (message.bbcCode !== "") { + obj.bbcCode = message.bbcCode; + } + if (message.bbcName !== "") { + obj.bbcName = message.bbcName; + } + if (message.bbcType !== "") { + obj.bbcType = message.bbcType; + } + if (message.noOfBob !== 0) { + obj.noOfBob = Math.round(message.noOfBob); + } + if (message.isActive !== false) { + obj.isActive = message.isActive; + } + if (message.notes !== "") { + obj.notes = message.notes; + } + if (message.rates?.length) { + obj.rates = message.rates.map((e) => BoxBobbinCostRate.toJSON(e)); + } + if (message.bbnReuse !== undefined) { + obj.bbnReuse = message.bbnReuse; + } + if (message.boxReuse !== undefined) { + obj.boxReuse = message.boxReuse; + } + if (message.boxCost !== undefined) { + obj.boxCost = message.boxCost; + } + if (message.bobinCost !== undefined) { + obj.bobinCost = message.bobinCost; + } + if (message.boxCostVal !== undefined) { + obj.boxCostVal = message.boxCostVal; + } + if (message.bobinCostVal !== undefined) { + obj.bobinCostVal = message.bobinCostVal; + } + if (message.bbnReuseVal !== undefined) { + obj.bbnReuseVal = message.bbnReuseVal; + } + if (message.audit !== undefined) { + obj.audit = AuditInfo.toJSON(message.audit); + } + if (message.boxReuseVal !== undefined) { + obj.boxReuseVal = message.boxReuseVal; + } + return obj; + }, + + create(base?: DeepPartial): BoxBobbinCost { + return BoxBobbinCost.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): BoxBobbinCost { + const message = createBaseBoxBobbinCost(); + message.bbcId = object.bbcId ?? ""; + message.bbcCode = object.bbcCode ?? ""; + message.bbcName = object.bbcName ?? ""; + message.bbcType = object.bbcType ?? ""; + message.noOfBob = object.noOfBob ?? 0; + message.isActive = object.isActive ?? false; + message.notes = object.notes ?? ""; + message.rates = object.rates?.map((e) => BoxBobbinCostRate.fromPartial(e)) || []; + message.bbnReuse = object.bbnReuse ?? undefined; + message.boxReuse = object.boxReuse ?? undefined; + message.boxCost = object.boxCost ?? undefined; + message.bobinCost = object.bobinCost ?? undefined; + message.boxCostVal = object.boxCostVal ?? undefined; + message.bobinCostVal = object.bobinCostVal ?? undefined; + message.bbnReuseVal = object.bbnReuseVal ?? undefined; + message.audit = (object.audit !== undefined && object.audit !== null) + ? AuditInfo.fromPartial(object.audit) + : undefined; + message.boxReuseVal = object.boxReuseVal ?? undefined; + return message; + }, +}; + +function createBaseCreateBoxBobbinCostRequest(): CreateBoxBobbinCostRequest { + return { + bbcCode: "", + bbcName: "", + bbcType: "", + noOfBob: 0, + notes: "", + bbnReuse: undefined, + boxReuse: undefined, + boxCost: undefined, + bobinCost: undefined, + boxCostVal: undefined, + bobinCostVal: undefined, + bbnReuseVal: undefined, + boxReuseVal: undefined, + }; +} + +export const CreateBoxBobbinCostRequest: MessageFns = { + encode(message: CreateBoxBobbinCostRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bbcCode !== "") { + writer.uint32(10).string(message.bbcCode); + } + if (message.bbcName !== "") { + writer.uint32(18).string(message.bbcName); + } + if (message.bbcType !== "") { + writer.uint32(26).string(message.bbcType); + } + if (message.noOfBob !== 0) { + writer.uint32(32).int32(message.noOfBob); + } + if (message.notes !== "") { + writer.uint32(42).string(message.notes); + } + if (message.bbnReuse !== undefined) { + writer.uint32(49).double(message.bbnReuse); + } + if (message.boxReuse !== undefined) { + writer.uint32(57).double(message.boxReuse); + } + if (message.boxCost !== undefined) { + writer.uint32(65).double(message.boxCost); + } + if (message.bobinCost !== undefined) { + writer.uint32(73).double(message.bobinCost); + } + if (message.boxCostVal !== undefined) { + writer.uint32(81).double(message.boxCostVal); + } + if (message.bobinCostVal !== undefined) { + writer.uint32(89).double(message.bobinCostVal); + } + if (message.bbnReuseVal !== undefined) { + writer.uint32(97).double(message.bbnReuseVal); + } + if (message.boxReuseVal !== undefined) { + writer.uint32(105).double(message.boxReuseVal); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateBoxBobbinCostRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateBoxBobbinCostRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bbcCode = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bbcName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.bbcType = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.noOfBob = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.notes = reader.string(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.bbnReuse = reader.double(); + continue; + } + case 7: { + if (tag !== 57) { + break; + } + + message.boxReuse = reader.double(); + continue; + } + case 8: { + if (tag !== 65) { + break; + } + + message.boxCost = reader.double(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.bobinCost = reader.double(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.boxCostVal = reader.double(); + continue; + } + case 11: { + if (tag !== 89) { + break; + } + + message.bobinCostVal = reader.double(); + continue; + } + case 12: { + if (tag !== 97) { + break; + } + + message.bbnReuseVal = reader.double(); + continue; + } + case 13: { + if (tag !== 105) { + break; + } + + message.boxReuseVal = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CreateBoxBobbinCostRequest { + return { + bbcCode: isSet(object.bbcCode) + ? globalThis.String(object.bbcCode) + : isSet(object.bbc_code) + ? globalThis.String(object.bbc_code) + : "", + bbcName: isSet(object.bbcName) + ? globalThis.String(object.bbcName) + : isSet(object.bbc_name) + ? globalThis.String(object.bbc_name) + : "", + bbcType: isSet(object.bbcType) + ? globalThis.String(object.bbcType) + : isSet(object.bbc_type) + ? globalThis.String(object.bbc_type) + : "", + noOfBob: isSet(object.noOfBob) + ? globalThis.Number(object.noOfBob) + : isSet(object.no_of_bob) + ? globalThis.Number(object.no_of_bob) + : 0, + notes: isSet(object.notes) ? globalThis.String(object.notes) : "", + bbnReuse: isSet(object.bbnReuse) + ? globalThis.Number(object.bbnReuse) + : isSet(object.bbn_reuse) + ? globalThis.Number(object.bbn_reuse) + : undefined, + boxReuse: isSet(object.boxReuse) + ? globalThis.Number(object.boxReuse) + : isSet(object.box_reuse) + ? globalThis.Number(object.box_reuse) + : undefined, + boxCost: isSet(object.boxCost) + ? globalThis.Number(object.boxCost) + : isSet(object.box_cost) + ? globalThis.Number(object.box_cost) + : undefined, + bobinCost: isSet(object.bobinCost) + ? globalThis.Number(object.bobinCost) + : isSet(object.bobin_cost) + ? globalThis.Number(object.bobin_cost) + : undefined, + boxCostVal: isSet(object.boxCostVal) + ? globalThis.Number(object.boxCostVal) + : isSet(object.box_cost_val) + ? globalThis.Number(object.box_cost_val) + : undefined, + bobinCostVal: isSet(object.bobinCostVal) + ? globalThis.Number(object.bobinCostVal) + : isSet(object.bobin_cost_val) + ? globalThis.Number(object.bobin_cost_val) + : undefined, + bbnReuseVal: isSet(object.bbnReuseVal) + ? globalThis.Number(object.bbnReuseVal) + : isSet(object.bbn_reuse_val) + ? globalThis.Number(object.bbn_reuse_val) + : undefined, + boxReuseVal: isSet(object.boxReuseVal) + ? globalThis.Number(object.boxReuseVal) + : isSet(object.box_reuse_val) + ? globalThis.Number(object.box_reuse_val) + : undefined, + }; + }, + + toJSON(message: CreateBoxBobbinCostRequest): unknown { + const obj: any = {}; + if (message.bbcCode !== "") { + obj.bbcCode = message.bbcCode; + } + if (message.bbcName !== "") { + obj.bbcName = message.bbcName; + } + if (message.bbcType !== "") { + obj.bbcType = message.bbcType; + } + if (message.noOfBob !== 0) { + obj.noOfBob = Math.round(message.noOfBob); + } + if (message.notes !== "") { + obj.notes = message.notes; + } + if (message.bbnReuse !== undefined) { + obj.bbnReuse = message.bbnReuse; + } + if (message.boxReuse !== undefined) { + obj.boxReuse = message.boxReuse; + } + if (message.boxCost !== undefined) { + obj.boxCost = message.boxCost; + } + if (message.bobinCost !== undefined) { + obj.bobinCost = message.bobinCost; + } + if (message.boxCostVal !== undefined) { + obj.boxCostVal = message.boxCostVal; + } + if (message.bobinCostVal !== undefined) { + obj.bobinCostVal = message.bobinCostVal; + } + if (message.bbnReuseVal !== undefined) { + obj.bbnReuseVal = message.bbnReuseVal; + } + if (message.boxReuseVal !== undefined) { + obj.boxReuseVal = message.boxReuseVal; + } + return obj; + }, + + create(base?: DeepPartial): CreateBoxBobbinCostRequest { + return CreateBoxBobbinCostRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateBoxBobbinCostRequest { + const message = createBaseCreateBoxBobbinCostRequest(); + message.bbcCode = object.bbcCode ?? ""; + message.bbcName = object.bbcName ?? ""; + message.bbcType = object.bbcType ?? ""; + message.noOfBob = object.noOfBob ?? 0; + message.notes = object.notes ?? ""; + message.bbnReuse = object.bbnReuse ?? undefined; + message.boxReuse = object.boxReuse ?? undefined; + message.boxCost = object.boxCost ?? undefined; + message.bobinCost = object.bobinCost ?? undefined; + message.boxCostVal = object.boxCostVal ?? undefined; + message.bobinCostVal = object.bobinCostVal ?? undefined; + message.bbnReuseVal = object.bbnReuseVal ?? undefined; + message.boxReuseVal = object.boxReuseVal ?? undefined; + return message; + }, +}; + +function createBaseCreateBoxBobbinCostResponse(): CreateBoxBobbinCostResponse { + return { base: undefined, data: undefined }; +} + +export const CreateBoxBobbinCostResponse: MessageFns = { + encode(message: CreateBoxBobbinCostResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + BoxBobbinCost.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateBoxBobbinCostResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateBoxBobbinCostResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = BoxBobbinCost.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CreateBoxBobbinCostResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? BoxBobbinCost.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: CreateBoxBobbinCostResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = BoxBobbinCost.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): CreateBoxBobbinCostResponse { + return CreateBoxBobbinCostResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateBoxBobbinCostResponse { + const message = createBaseCreateBoxBobbinCostResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? BoxBobbinCost.fromPartial(object.data) + : undefined; + return message; + }, +}; + +function createBaseGetBoxBobbinCostRequest(): GetBoxBobbinCostRequest { + return { bbcId: "" }; +} + +export const GetBoxBobbinCostRequest: MessageFns = { + encode(message: GetBoxBobbinCostRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bbcId !== "") { + writer.uint32(10).string(message.bbcId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetBoxBobbinCostRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBoxBobbinCostRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bbcId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetBoxBobbinCostRequest { + return { + bbcId: isSet(object.bbcId) + ? globalThis.String(object.bbcId) + : isSet(object.bbc_id) + ? globalThis.String(object.bbc_id) + : "", + }; + }, + + toJSON(message: GetBoxBobbinCostRequest): unknown { + const obj: any = {}; + if (message.bbcId !== "") { + obj.bbcId = message.bbcId; + } + return obj; + }, + + create(base?: DeepPartial): GetBoxBobbinCostRequest { + return GetBoxBobbinCostRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetBoxBobbinCostRequest { + const message = createBaseGetBoxBobbinCostRequest(); + message.bbcId = object.bbcId ?? ""; + return message; + }, +}; + +function createBaseGetBoxBobbinCostResponse(): GetBoxBobbinCostResponse { + return { base: undefined, data: undefined }; +} + +export const GetBoxBobbinCostResponse: MessageFns = { + encode(message: GetBoxBobbinCostResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + BoxBobbinCost.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetBoxBobbinCostResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetBoxBobbinCostResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = BoxBobbinCost.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetBoxBobbinCostResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? BoxBobbinCost.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: GetBoxBobbinCostResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = BoxBobbinCost.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): GetBoxBobbinCostResponse { + return GetBoxBobbinCostResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetBoxBobbinCostResponse { + const message = createBaseGetBoxBobbinCostResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? BoxBobbinCost.fromPartial(object.data) + : undefined; + return message; + }, +}; + +function createBaseUpdateBoxBobbinCostRequest(): UpdateBoxBobbinCostRequest { + return { + bbcId: "", + bbcName: undefined, + bbcType: undefined, + noOfBob: undefined, + notes: undefined, + isActive: undefined, + bbnReuse: undefined, + boxReuse: undefined, + boxCost: undefined, + bobinCost: undefined, + boxCostVal: undefined, + bobinCostVal: undefined, + bbnReuseVal: undefined, + boxReuseVal: undefined, + }; +} + +export const UpdateBoxBobbinCostRequest: MessageFns = { + encode(message: UpdateBoxBobbinCostRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bbcId !== "") { + writer.uint32(10).string(message.bbcId); + } + if (message.bbcName !== undefined) { + writer.uint32(18).string(message.bbcName); + } + if (message.bbcType !== undefined) { + writer.uint32(26).string(message.bbcType); + } + if (message.noOfBob !== undefined) { + writer.uint32(32).int32(message.noOfBob); + } + if (message.notes !== undefined) { + writer.uint32(42).string(message.notes); + } + if (message.isActive !== undefined) { + writer.uint32(48).bool(message.isActive); + } + if (message.bbnReuse !== undefined) { + writer.uint32(57).double(message.bbnReuse); + } + if (message.boxReuse !== undefined) { + writer.uint32(65).double(message.boxReuse); + } + if (message.boxCost !== undefined) { + writer.uint32(73).double(message.boxCost); + } + if (message.bobinCost !== undefined) { + writer.uint32(81).double(message.bobinCost); + } + if (message.boxCostVal !== undefined) { + writer.uint32(89).double(message.boxCostVal); + } + if (message.bobinCostVal !== undefined) { + writer.uint32(97).double(message.bobinCostVal); + } + if (message.bbnReuseVal !== undefined) { + writer.uint32(105).double(message.bbnReuseVal); + } + if (message.boxReuseVal !== undefined) { + writer.uint32(113).double(message.boxReuseVal); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateBoxBobbinCostRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateBoxBobbinCostRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bbcId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bbcName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.bbcType = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.noOfBob = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.notes = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.isActive = reader.bool(); + continue; + } + case 7: { + if (tag !== 57) { + break; + } + + message.bbnReuse = reader.double(); + continue; + } + case 8: { + if (tag !== 65) { + break; + } + + message.boxReuse = reader.double(); + continue; + } + case 9: { + if (tag !== 73) { + break; + } + + message.boxCost = reader.double(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.bobinCost = reader.double(); + continue; + } + case 11: { + if (tag !== 89) { + break; + } + + message.boxCostVal = reader.double(); + continue; + } + case 12: { + if (tag !== 97) { + break; + } + + message.bobinCostVal = reader.double(); + continue; + } + case 13: { + if (tag !== 105) { + break; + } + + message.bbnReuseVal = reader.double(); + continue; + } + case 14: { + if (tag !== 113) { + break; + } + + message.boxReuseVal = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateBoxBobbinCostRequest { + return { + bbcId: isSet(object.bbcId) + ? globalThis.String(object.bbcId) + : isSet(object.bbc_id) + ? globalThis.String(object.bbc_id) + : "", + bbcName: isSet(object.bbcName) + ? globalThis.String(object.bbcName) + : isSet(object.bbc_name) + ? globalThis.String(object.bbc_name) + : undefined, + bbcType: isSet(object.bbcType) + ? globalThis.String(object.bbcType) + : isSet(object.bbc_type) + ? globalThis.String(object.bbc_type) + : undefined, + noOfBob: isSet(object.noOfBob) + ? globalThis.Number(object.noOfBob) + : isSet(object.no_of_bob) + ? globalThis.Number(object.no_of_bob) + : undefined, + notes: isSet(object.notes) ? globalThis.String(object.notes) : undefined, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : undefined, + bbnReuse: isSet(object.bbnReuse) + ? globalThis.Number(object.bbnReuse) + : isSet(object.bbn_reuse) + ? globalThis.Number(object.bbn_reuse) + : undefined, + boxReuse: isSet(object.boxReuse) + ? globalThis.Number(object.boxReuse) + : isSet(object.box_reuse) + ? globalThis.Number(object.box_reuse) + : undefined, + boxCost: isSet(object.boxCost) + ? globalThis.Number(object.boxCost) + : isSet(object.box_cost) + ? globalThis.Number(object.box_cost) + : undefined, + bobinCost: isSet(object.bobinCost) + ? globalThis.Number(object.bobinCost) + : isSet(object.bobin_cost) + ? globalThis.Number(object.bobin_cost) + : undefined, + boxCostVal: isSet(object.boxCostVal) + ? globalThis.Number(object.boxCostVal) + : isSet(object.box_cost_val) + ? globalThis.Number(object.box_cost_val) + : undefined, + bobinCostVal: isSet(object.bobinCostVal) + ? globalThis.Number(object.bobinCostVal) + : isSet(object.bobin_cost_val) + ? globalThis.Number(object.bobin_cost_val) + : undefined, + bbnReuseVal: isSet(object.bbnReuseVal) + ? globalThis.Number(object.bbnReuseVal) + : isSet(object.bbn_reuse_val) + ? globalThis.Number(object.bbn_reuse_val) + : undefined, + boxReuseVal: isSet(object.boxReuseVal) + ? globalThis.Number(object.boxReuseVal) + : isSet(object.box_reuse_val) + ? globalThis.Number(object.box_reuse_val) + : undefined, + }; + }, + + toJSON(message: UpdateBoxBobbinCostRequest): unknown { + const obj: any = {}; + if (message.bbcId !== "") { + obj.bbcId = message.bbcId; + } + if (message.bbcName !== undefined) { + obj.bbcName = message.bbcName; + } + if (message.bbcType !== undefined) { + obj.bbcType = message.bbcType; + } + if (message.noOfBob !== undefined) { + obj.noOfBob = Math.round(message.noOfBob); + } + if (message.notes !== undefined) { + obj.notes = message.notes; + } + if (message.isActive !== undefined) { + obj.isActive = message.isActive; + } + if (message.bbnReuse !== undefined) { + obj.bbnReuse = message.bbnReuse; + } + if (message.boxReuse !== undefined) { + obj.boxReuse = message.boxReuse; + } + if (message.boxCost !== undefined) { + obj.boxCost = message.boxCost; + } + if (message.bobinCost !== undefined) { + obj.bobinCost = message.bobinCost; + } + if (message.boxCostVal !== undefined) { + obj.boxCostVal = message.boxCostVal; + } + if (message.bobinCostVal !== undefined) { + obj.bobinCostVal = message.bobinCostVal; + } + if (message.bbnReuseVal !== undefined) { + obj.bbnReuseVal = message.bbnReuseVal; + } + if (message.boxReuseVal !== undefined) { + obj.boxReuseVal = message.boxReuseVal; + } + return obj; + }, + + create(base?: DeepPartial): UpdateBoxBobbinCostRequest { + return UpdateBoxBobbinCostRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateBoxBobbinCostRequest { + const message = createBaseUpdateBoxBobbinCostRequest(); + message.bbcId = object.bbcId ?? ""; + message.bbcName = object.bbcName ?? undefined; + message.bbcType = object.bbcType ?? undefined; + message.noOfBob = object.noOfBob ?? undefined; + message.notes = object.notes ?? undefined; + message.isActive = object.isActive ?? undefined; + message.bbnReuse = object.bbnReuse ?? undefined; + message.boxReuse = object.boxReuse ?? undefined; + message.boxCost = object.boxCost ?? undefined; + message.bobinCost = object.bobinCost ?? undefined; + message.boxCostVal = object.boxCostVal ?? undefined; + message.bobinCostVal = object.bobinCostVal ?? undefined; + message.bbnReuseVal = object.bbnReuseVal ?? undefined; + message.boxReuseVal = object.boxReuseVal ?? undefined; + return message; + }, +}; + +function createBaseUpdateBoxBobbinCostResponse(): UpdateBoxBobbinCostResponse { + return { base: undefined, data: undefined }; +} + +export const UpdateBoxBobbinCostResponse: MessageFns = { + encode(message: UpdateBoxBobbinCostResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + BoxBobbinCost.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateBoxBobbinCostResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateBoxBobbinCostResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = BoxBobbinCost.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateBoxBobbinCostResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? BoxBobbinCost.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: UpdateBoxBobbinCostResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = BoxBobbinCost.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): UpdateBoxBobbinCostResponse { + return UpdateBoxBobbinCostResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateBoxBobbinCostResponse { + const message = createBaseUpdateBoxBobbinCostResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? BoxBobbinCost.fromPartial(object.data) + : undefined; + return message; + }, +}; + +function createBaseDeleteBoxBobbinCostRequest(): DeleteBoxBobbinCostRequest { + return { bbcId: "" }; +} + +export const DeleteBoxBobbinCostRequest: MessageFns = { + encode(message: DeleteBoxBobbinCostRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bbcId !== "") { + writer.uint32(10).string(message.bbcId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteBoxBobbinCostRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteBoxBobbinCostRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bbcId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteBoxBobbinCostRequest { + return { + bbcId: isSet(object.bbcId) + ? globalThis.String(object.bbcId) + : isSet(object.bbc_id) + ? globalThis.String(object.bbc_id) + : "", + }; + }, + + toJSON(message: DeleteBoxBobbinCostRequest): unknown { + const obj: any = {}; + if (message.bbcId !== "") { + obj.bbcId = message.bbcId; + } + return obj; + }, + + create(base?: DeepPartial): DeleteBoxBobbinCostRequest { + return DeleteBoxBobbinCostRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteBoxBobbinCostRequest { + const message = createBaseDeleteBoxBobbinCostRequest(); + message.bbcId = object.bbcId ?? ""; + return message; + }, +}; + +function createBaseDeleteBoxBobbinCostResponse(): DeleteBoxBobbinCostResponse { + return { base: undefined }; +} + +export const DeleteBoxBobbinCostResponse: MessageFns = { + encode(message: DeleteBoxBobbinCostResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteBoxBobbinCostResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteBoxBobbinCostResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteBoxBobbinCostResponse { + return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; + }, + + toJSON(message: DeleteBoxBobbinCostResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + return obj; + }, + + create(base?: DeepPartial): DeleteBoxBobbinCostResponse { + return DeleteBoxBobbinCostResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteBoxBobbinCostResponse { + const message = createBaseDeleteBoxBobbinCostResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + return message; + }, +}; + +function createBaseListBoxBobbinCostsRequest(): ListBoxBobbinCostsRequest { + return { page: 0, pageSize: 0, search: "", bbcType: "", activeFilter: 0, sortBy: "", sortOrder: "" }; +} + +export const ListBoxBobbinCostsRequest: MessageFns = { + encode(message: ListBoxBobbinCostsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.page !== 0) { + writer.uint32(8).int32(message.page); + } + if (message.pageSize !== 0) { + writer.uint32(16).int32(message.pageSize); + } + if (message.search !== "") { + writer.uint32(26).string(message.search); + } + if (message.bbcType !== "") { + writer.uint32(34).string(message.bbcType); + } + if (message.activeFilter !== 0) { + writer.uint32(40).int32(message.activeFilter); + } + if (message.sortBy !== "") { + writer.uint32(50).string(message.sortBy); + } + if (message.sortOrder !== "") { + writer.uint32(58).string(message.sortOrder); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListBoxBobbinCostsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListBoxBobbinCostsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.page = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.pageSize = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.search = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.bbcType = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.activeFilter = reader.int32() as any; + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.sortBy = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.sortOrder = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListBoxBobbinCostsRequest { + return { + page: isSet(object.page) ? globalThis.Number(object.page) : 0, + pageSize: isSet(object.pageSize) + ? globalThis.Number(object.pageSize) + : isSet(object.page_size) + ? globalThis.Number(object.page_size) + : 0, + search: isSet(object.search) ? globalThis.String(object.search) : "", + bbcType: isSet(object.bbcType) + ? globalThis.String(object.bbcType) + : isSet(object.bbc_type) + ? globalThis.String(object.bbc_type) + : "", + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, + sortBy: isSet(object.sortBy) + ? globalThis.String(object.sortBy) + : isSet(object.sort_by) + ? globalThis.String(object.sort_by) + : "", + sortOrder: isSet(object.sortOrder) + ? globalThis.String(object.sortOrder) + : isSet(object.sort_order) + ? globalThis.String(object.sort_order) + : "", + }; + }, + + toJSON(message: ListBoxBobbinCostsRequest): unknown { + const obj: any = {}; + if (message.page !== 0) { + obj.page = Math.round(message.page); + } + if (message.pageSize !== 0) { + obj.pageSize = Math.round(message.pageSize); + } + if (message.search !== "") { + obj.search = message.search; + } + if (message.bbcType !== "") { + obj.bbcType = message.bbcType; + } + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); + } + if (message.sortBy !== "") { + obj.sortBy = message.sortBy; + } + if (message.sortOrder !== "") { + obj.sortOrder = message.sortOrder; + } + return obj; + }, + + create(base?: DeepPartial): ListBoxBobbinCostsRequest { + return ListBoxBobbinCostsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListBoxBobbinCostsRequest { + const message = createBaseListBoxBobbinCostsRequest(); + message.page = object.page ?? 0; + message.pageSize = object.pageSize ?? 0; + message.search = object.search ?? ""; + message.bbcType = object.bbcType ?? ""; + message.activeFilter = object.activeFilter ?? 0; + message.sortBy = object.sortBy ?? ""; + message.sortOrder = object.sortOrder ?? ""; + return message; + }, +}; + +function createBaseListBoxBobbinCostsResponse(): ListBoxBobbinCostsResponse { + return { base: undefined, data: [], pagination: undefined }; +} + +export const ListBoxBobbinCostsResponse: MessageFns = { + encode(message: ListBoxBobbinCostsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + for (const v of message.data) { + BoxBobbinCost.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.pagination !== undefined) { + PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListBoxBobbinCostsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListBoxBobbinCostsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data.push(BoxBobbinCost.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pagination = PaginationResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListBoxBobbinCostsResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => BoxBobbinCost.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: ListBoxBobbinCostsResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data?.length) { + obj.data = message.data.map((e) => BoxBobbinCost.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PaginationResponse.toJSON(message.pagination); + } + return obj; + }, + + create(base?: DeepPartial): ListBoxBobbinCostsResponse { + return ListBoxBobbinCostsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListBoxBobbinCostsResponse { + const message = createBaseListBoxBobbinCostsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = object.data?.map((e) => BoxBobbinCost.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PaginationResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseCreateBoxBobbinCostRateRequest(): CreateBoxBobbinCostRateRequest { + return { + bbcId: "", + bbcrPeriod: "", + bbcrBobRateMkt: 0, + bbcrBoxRateMkt: 0, + bbcrBobRateVal: undefined, + bbcrBoxRateVal: undefined, + }; +} + +export const CreateBoxBobbinCostRateRequest: MessageFns = { + encode(message: CreateBoxBobbinCostRateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bbcId !== "") { + writer.uint32(10).string(message.bbcId); + } + if (message.bbcrPeriod !== "") { + writer.uint32(18).string(message.bbcrPeriod); + } + if (message.bbcrBobRateMkt !== 0) { + writer.uint32(25).double(message.bbcrBobRateMkt); + } + if (message.bbcrBoxRateMkt !== 0) { + writer.uint32(33).double(message.bbcrBoxRateMkt); + } + if (message.bbcrBobRateVal !== undefined) { + writer.uint32(41).double(message.bbcrBobRateVal); + } + if (message.bbcrBoxRateVal !== undefined) { + writer.uint32(49).double(message.bbcrBoxRateVal); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateBoxBobbinCostRateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateBoxBobbinCostRateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bbcId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bbcrPeriod = reader.string(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.bbcrBobRateMkt = reader.double(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.bbcrBoxRateMkt = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.bbcrBobRateVal = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.bbcrBoxRateVal = reader.double(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CreateBoxBobbinCostRateRequest { + return { + bbcId: isSet(object.bbcId) + ? globalThis.String(object.bbcId) + : isSet(object.bbc_id) + ? globalThis.String(object.bbc_id) + : "", + bbcrPeriod: isSet(object.bbcrPeriod) + ? globalThis.String(object.bbcrPeriod) + : isSet(object.bbcr_period) + ? globalThis.String(object.bbcr_period) + : "", + bbcrBobRateMkt: isSet(object.bbcrBobRateMkt) + ? globalThis.Number(object.bbcrBobRateMkt) + : isSet(object.bbcr_bob_rate_mkt) + ? globalThis.Number(object.bbcr_bob_rate_mkt) + : 0, + bbcrBoxRateMkt: isSet(object.bbcrBoxRateMkt) + ? globalThis.Number(object.bbcrBoxRateMkt) + : isSet(object.bbcr_box_rate_mkt) + ? globalThis.Number(object.bbcr_box_rate_mkt) + : 0, + bbcrBobRateVal: isSet(object.bbcrBobRateVal) + ? globalThis.Number(object.bbcrBobRateVal) + : isSet(object.bbcr_bob_rate_val) + ? globalThis.Number(object.bbcr_bob_rate_val) + : undefined, + bbcrBoxRateVal: isSet(object.bbcrBoxRateVal) + ? globalThis.Number(object.bbcrBoxRateVal) + : isSet(object.bbcr_box_rate_val) + ? globalThis.Number(object.bbcr_box_rate_val) + : undefined, + }; + }, + + toJSON(message: CreateBoxBobbinCostRateRequest): unknown { + const obj: any = {}; + if (message.bbcId !== "") { + obj.bbcId = message.bbcId; + } + if (message.bbcrPeriod !== "") { + obj.bbcrPeriod = message.bbcrPeriod; + } + if (message.bbcrBobRateMkt !== 0) { + obj.bbcrBobRateMkt = message.bbcrBobRateMkt; + } + if (message.bbcrBoxRateMkt !== 0) { + obj.bbcrBoxRateMkt = message.bbcrBoxRateMkt; + } + if (message.bbcrBobRateVal !== undefined) { + obj.bbcrBobRateVal = message.bbcrBobRateVal; + } + if (message.bbcrBoxRateVal !== undefined) { + obj.bbcrBoxRateVal = message.bbcrBoxRateVal; + } + return obj; + }, + + create(base?: DeepPartial): CreateBoxBobbinCostRateRequest { + return CreateBoxBobbinCostRateRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateBoxBobbinCostRateRequest { + const message = createBaseCreateBoxBobbinCostRateRequest(); + message.bbcId = object.bbcId ?? ""; + message.bbcrPeriod = object.bbcrPeriod ?? ""; + message.bbcrBobRateMkt = object.bbcrBobRateMkt ?? 0; + message.bbcrBoxRateMkt = object.bbcrBoxRateMkt ?? 0; + message.bbcrBobRateVal = object.bbcrBobRateVal ?? undefined; + message.bbcrBoxRateVal = object.bbcrBoxRateVal ?? undefined; + return message; + }, +}; + +function createBaseCreateBoxBobbinCostRateResponse(): CreateBoxBobbinCostRateResponse { + return { base: undefined, data: undefined }; +} + +export const CreateBoxBobbinCostRateResponse: MessageFns = { + encode(message: CreateBoxBobbinCostRateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + BoxBobbinCostRate.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateBoxBobbinCostRateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateBoxBobbinCostRateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = BoxBobbinCostRate.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CreateBoxBobbinCostRateResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? BoxBobbinCostRate.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: CreateBoxBobbinCostRateResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = BoxBobbinCostRate.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): CreateBoxBobbinCostRateResponse { + return CreateBoxBobbinCostRateResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateBoxBobbinCostRateResponse { + const message = createBaseCreateBoxBobbinCostRateResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? BoxBobbinCostRate.fromPartial(object.data) + : undefined; + return message; + }, +}; + +function createBaseDeleteBoxBobbinCostRateRequest(): DeleteBoxBobbinCostRateRequest { + return { bbcId: "", bbcrId: "" }; +} + +export const DeleteBoxBobbinCostRateRequest: MessageFns = { + encode(message: DeleteBoxBobbinCostRateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.bbcId !== "") { + writer.uint32(10).string(message.bbcId); + } + if (message.bbcrId !== "") { + writer.uint32(18).string(message.bbcrId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteBoxBobbinCostRateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteBoxBobbinCostRateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.bbcId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.bbcrId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteBoxBobbinCostRateRequest { + return { + bbcId: isSet(object.bbcId) + ? globalThis.String(object.bbcId) + : isSet(object.bbc_id) + ? globalThis.String(object.bbc_id) + : "", + bbcrId: isSet(object.bbcrId) + ? globalThis.String(object.bbcrId) + : isSet(object.bbcr_id) + ? globalThis.String(object.bbcr_id) + : "", + }; + }, + + toJSON(message: DeleteBoxBobbinCostRateRequest): unknown { + const obj: any = {}; + if (message.bbcId !== "") { + obj.bbcId = message.bbcId; + } + if (message.bbcrId !== "") { + obj.bbcrId = message.bbcrId; + } + return obj; + }, + + create(base?: DeepPartial): DeleteBoxBobbinCostRateRequest { + return DeleteBoxBobbinCostRateRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteBoxBobbinCostRateRequest { + const message = createBaseDeleteBoxBobbinCostRateRequest(); + message.bbcId = object.bbcId ?? ""; + message.bbcrId = object.bbcrId ?? ""; + return message; + }, +}; + +function createBaseDeleteBoxBobbinCostRateResponse(): DeleteBoxBobbinCostRateResponse { + return { base: undefined }; +} + +export const DeleteBoxBobbinCostRateResponse: MessageFns = { + encode(message: DeleteBoxBobbinCostRateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteBoxBobbinCostRateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteBoxBobbinCostRateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteBoxBobbinCostRateResponse { + return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; + }, + + toJSON(message: DeleteBoxBobbinCostRateResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + return obj; + }, + + create(base?: DeepPartial): DeleteBoxBobbinCostRateResponse { + return DeleteBoxBobbinCostRateResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteBoxBobbinCostRateResponse { + const message = createBaseDeleteBoxBobbinCostRateResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + return message; + }, +}; + +function createBaseExportBoxBobbinCostsRequest(): ExportBoxBobbinCostsRequest { + return { activeFilter: 0 }; +} + +export const ExportBoxBobbinCostsRequest: MessageFns = { + encode(message: ExportBoxBobbinCostsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.activeFilter !== 0) { + writer.uint32(8).int32(message.activeFilter); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExportBoxBobbinCostsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExportBoxBobbinCostsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.activeFilter = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExportBoxBobbinCostsRequest { + return { + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, + }; + }, + + toJSON(message: ExportBoxBobbinCostsRequest): unknown { + const obj: any = {}; + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); + } + return obj; + }, + + create(base?: DeepPartial): ExportBoxBobbinCostsRequest { + return ExportBoxBobbinCostsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExportBoxBobbinCostsRequest { + const message = createBaseExportBoxBobbinCostsRequest(); + message.activeFilter = object.activeFilter ?? 0; + return message; + }, +}; + +function createBaseExportBoxBobbinCostsResponse(): ExportBoxBobbinCostsResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +} + +export const ExportBoxBobbinCostsResponse: MessageFns = { + encode(message: ExportBoxBobbinCostsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExportBoxBobbinCostsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExportBoxBobbinCostsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExportBoxBobbinCostsResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + }; + }, + + toJSON(message: ExportBoxBobbinCostsResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + return obj; + }, + + create(base?: DeepPartial): ExportBoxBobbinCostsResponse { + return ExportBoxBobbinCostsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExportBoxBobbinCostsResponse { + const message = createBaseExportBoxBobbinCostsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + return message; + }, +}; + +function createBaseImportBoxBobbinCostsRequest(): ImportBoxBobbinCostsRequest { + return { fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; +} + +export const ImportBoxBobbinCostsRequest: MessageFns = { + encode(message: ImportBoxBobbinCostsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.fileContent.length !== 0) { + writer.uint32(10).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(18).string(message.fileName); + } + if (message.duplicateAction !== "") { + writer.uint32(26).string(message.duplicateAction); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ImportBoxBobbinCostsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseImportBoxBobbinCostsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.duplicateAction = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ImportBoxBobbinCostsRequest { + return { + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + duplicateAction: isSet(object.duplicateAction) + ? globalThis.String(object.duplicateAction) + : isSet(object.duplicate_action) + ? globalThis.String(object.duplicate_action) + : "", + }; + }, + + toJSON(message: ImportBoxBobbinCostsRequest): unknown { + const obj: any = {}; + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + if (message.duplicateAction !== "") { + obj.duplicateAction = message.duplicateAction; + } + return obj; + }, + + create(base?: DeepPartial): ImportBoxBobbinCostsRequest { + return ImportBoxBobbinCostsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ImportBoxBobbinCostsRequest { + const message = createBaseImportBoxBobbinCostsRequest(); + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + message.duplicateAction = object.duplicateAction ?? ""; + return message; + }, +}; + +function createBaseImportBoxBobbinCostsResponse(): ImportBoxBobbinCostsResponse { + return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; +} + +export const ImportBoxBobbinCostsResponse: MessageFns = { + encode(message: ImportBoxBobbinCostsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.successCount !== 0) { + writer.uint32(16).int32(message.successCount); + } + if (message.skippedCount !== 0) { + writer.uint32(24).int32(message.skippedCount); + } + if (message.failedCount !== 0) { + writer.uint32(32).int32(message.failedCount); + } + for (const v of message.errors) { + ImportError.encode(v!, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ImportBoxBobbinCostsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseImportBoxBobbinCostsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.successCount = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.skippedCount = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.failedCount = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.errors.push(ImportError.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ImportBoxBobbinCostsResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + successCount: isSet(object.successCount) + ? globalThis.Number(object.successCount) + : isSet(object.success_count) + ? globalThis.Number(object.success_count) + : 0, + skippedCount: isSet(object.skippedCount) + ? globalThis.Number(object.skippedCount) + : isSet(object.skipped_count) + ? globalThis.Number(object.skipped_count) + : 0, + failedCount: isSet(object.failedCount) + ? globalThis.Number(object.failedCount) + : isSet(object.failed_count) + ? globalThis.Number(object.failed_count) + : 0, + errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => ImportError.fromJSON(e)) : [], + }; + }, + + toJSON(message: ImportBoxBobbinCostsResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.successCount !== 0) { + obj.successCount = Math.round(message.successCount); + } + if (message.skippedCount !== 0) { + obj.skippedCount = Math.round(message.skippedCount); + } + if (message.failedCount !== 0) { + obj.failedCount = Math.round(message.failedCount); + } + if (message.errors?.length) { + obj.errors = message.errors.map((e) => ImportError.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ImportBoxBobbinCostsResponse { + return ImportBoxBobbinCostsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ImportBoxBobbinCostsResponse { + const message = createBaseImportBoxBobbinCostsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.successCount = object.successCount ?? 0; + message.skippedCount = object.skippedCount ?? 0; + message.failedCount = object.failedCount ?? 0; + message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDownloadBoxBobbinCostTemplateRequest(): DownloadBoxBobbinCostTemplateRequest { + return {}; +} + +export const DownloadBoxBobbinCostTemplateRequest: MessageFns = { + encode(_: DownloadBoxBobbinCostTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DownloadBoxBobbinCostTemplateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDownloadBoxBobbinCostTemplateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): DownloadBoxBobbinCostTemplateRequest { + return {}; + }, + + toJSON(_: DownloadBoxBobbinCostTemplateRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): DownloadBoxBobbinCostTemplateRequest { + return DownloadBoxBobbinCostTemplateRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): DownloadBoxBobbinCostTemplateRequest { + const message = createBaseDownloadBoxBobbinCostTemplateRequest(); + return message; + }, +}; + +function createBaseDownloadBoxBobbinCostTemplateResponse(): DownloadBoxBobbinCostTemplateResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +} + +export const DownloadBoxBobbinCostTemplateResponse: MessageFns = { + encode(message: DownloadBoxBobbinCostTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DownloadBoxBobbinCostTemplateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDownloadBoxBobbinCostTemplateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DownloadBoxBobbinCostTemplateResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + }; + }, + + toJSON(message: DownloadBoxBobbinCostTemplateResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + return obj; + }, + + create(base?: DeepPartial): DownloadBoxBobbinCostTemplateResponse { + return DownloadBoxBobbinCostTemplateResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DownloadBoxBobbinCostTemplateResponse { + const message = createBaseDownloadBoxBobbinCostTemplateResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + return message; + }, +}; + +function createBaseIntermingling(): Intermingling { + return { intmId: "", intmCode: "", intmName: "", intmCostPerKg: 0, isActive: false, notes: "", audit: undefined }; +} + +export const Intermingling: MessageFns = { + encode(message: Intermingling, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.intmId !== "") { + writer.uint32(10).string(message.intmId); + } + if (message.intmCode !== "") { + writer.uint32(18).string(message.intmCode); + } + if (message.intmName !== "") { + writer.uint32(26).string(message.intmName); + } + if (message.intmCostPerKg !== 0) { + writer.uint32(33).double(message.intmCostPerKg); + } + if (message.isActive !== false) { + writer.uint32(40).bool(message.isActive); + } + if (message.notes !== "") { + writer.uint32(50).string(message.notes); + } + if (message.audit !== undefined) { + AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): Intermingling { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseIntermingling(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.intmId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.intmCode = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.intmName = reader.string(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.intmCostPerKg = reader.double(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.isActive = reader.bool(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.notes = reader.string(); + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.audit = AuditInfo.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): Intermingling { + return { + intmId: isSet(object.intmId) + ? globalThis.String(object.intmId) + : isSet(object.intm_id) + ? globalThis.String(object.intm_id) + : "", + intmCode: isSet(object.intmCode) + ? globalThis.String(object.intmCode) + : isSet(object.intm_code) + ? globalThis.String(object.intm_code) + : "", + intmName: isSet(object.intmName) + ? globalThis.String(object.intmName) + : isSet(object.intm_name) + ? globalThis.String(object.intm_name) + : "", + intmCostPerKg: isSet(object.intmCostPerKg) + ? globalThis.Number(object.intmCostPerKg) + : isSet(object.intm_cost_per_kg) + ? globalThis.Number(object.intm_cost_per_kg) + : 0, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, + notes: isSet(object.notes) ? globalThis.String(object.notes) : "", + audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, + }; + }, + + toJSON(message: Intermingling): unknown { + const obj: any = {}; + if (message.intmId !== "") { + obj.intmId = message.intmId; + } + if (message.intmCode !== "") { + obj.intmCode = message.intmCode; + } + if (message.intmName !== "") { + obj.intmName = message.intmName; + } + if (message.intmCostPerKg !== 0) { + obj.intmCostPerKg = message.intmCostPerKg; + } + if (message.isActive !== false) { + obj.isActive = message.isActive; + } + if (message.notes !== "") { + obj.notes = message.notes; + } + if (message.audit !== undefined) { + obj.audit = AuditInfo.toJSON(message.audit); + } + return obj; + }, + + create(base?: DeepPartial): Intermingling { + return Intermingling.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): Intermingling { + const message = createBaseIntermingling(); + message.intmId = object.intmId ?? ""; + message.intmCode = object.intmCode ?? ""; + message.intmName = object.intmName ?? ""; + message.intmCostPerKg = object.intmCostPerKg ?? 0; + message.isActive = object.isActive ?? false; + message.notes = object.notes ?? ""; + message.audit = (object.audit !== undefined && object.audit !== null) + ? AuditInfo.fromPartial(object.audit) + : undefined; + return message; + }, +}; + +function createBaseCreateInterminglingRequest(): CreateInterminglingRequest { + return { intmCode: "", intmName: "", intmCostPerKg: 0, notes: "" }; +} + +export const CreateInterminglingRequest: MessageFns = { + encode(message: CreateInterminglingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.intmCode !== "") { + writer.uint32(10).string(message.intmCode); + } + if (message.intmName !== "") { + writer.uint32(18).string(message.intmName); + } + if (message.intmCostPerKg !== 0) { + writer.uint32(25).double(message.intmCostPerKg); + } + if (message.notes !== "") { + writer.uint32(34).string(message.notes); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateInterminglingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateInterminglingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.intmCode = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.intmName = reader.string(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.intmCostPerKg = reader.double(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.notes = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CreateInterminglingRequest { + return { + intmCode: isSet(object.intmCode) + ? globalThis.String(object.intmCode) + : isSet(object.intm_code) + ? globalThis.String(object.intm_code) + : "", + intmName: isSet(object.intmName) + ? globalThis.String(object.intmName) + : isSet(object.intm_name) + ? globalThis.String(object.intm_name) + : "", + intmCostPerKg: isSet(object.intmCostPerKg) + ? globalThis.Number(object.intmCostPerKg) + : isSet(object.intm_cost_per_kg) + ? globalThis.Number(object.intm_cost_per_kg) + : 0, + notes: isSet(object.notes) ? globalThis.String(object.notes) : "", + }; + }, + + toJSON(message: CreateInterminglingRequest): unknown { + const obj: any = {}; + if (message.intmCode !== "") { + obj.intmCode = message.intmCode; + } + if (message.intmName !== "") { + obj.intmName = message.intmName; + } + if (message.intmCostPerKg !== 0) { + obj.intmCostPerKg = message.intmCostPerKg; + } + if (message.notes !== "") { + obj.notes = message.notes; + } + return obj; + }, + + create(base?: DeepPartial): CreateInterminglingRequest { + return CreateInterminglingRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateInterminglingRequest { + const message = createBaseCreateInterminglingRequest(); + message.intmCode = object.intmCode ?? ""; + message.intmName = object.intmName ?? ""; + message.intmCostPerKg = object.intmCostPerKg ?? 0; + message.notes = object.notes ?? ""; + return message; + }, +}; + +function createBaseCreateInterminglingResponse(): CreateInterminglingResponse { + return { base: undefined, data: undefined }; +} + +export const CreateInterminglingResponse: MessageFns = { + encode(message: CreateInterminglingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + Intermingling.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateInterminglingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateInterminglingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = Intermingling.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CreateInterminglingResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? Intermingling.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: CreateInterminglingResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = Intermingling.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): CreateInterminglingResponse { + return CreateInterminglingResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateInterminglingResponse { + const message = createBaseCreateInterminglingResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? Intermingling.fromPartial(object.data) + : undefined; + return message; + }, +}; + +function createBaseGetInterminglingRequest(): GetInterminglingRequest { + return { intmId: "" }; +} + +export const GetInterminglingRequest: MessageFns = { + encode(message: GetInterminglingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.intmId !== "") { + writer.uint32(10).string(message.intmId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetInterminglingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetInterminglingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.intmId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetInterminglingRequest { + return { + intmId: isSet(object.intmId) + ? globalThis.String(object.intmId) + : isSet(object.intm_id) + ? globalThis.String(object.intm_id) + : "", + }; + }, + + toJSON(message: GetInterminglingRequest): unknown { + const obj: any = {}; + if (message.intmId !== "") { + obj.intmId = message.intmId; + } + return obj; + }, + + create(base?: DeepPartial): GetInterminglingRequest { + return GetInterminglingRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetInterminglingRequest { + const message = createBaseGetInterminglingRequest(); + message.intmId = object.intmId ?? ""; + return message; + }, +}; + +function createBaseGetInterminglingResponse(): GetInterminglingResponse { + return { base: undefined, data: undefined }; +} + +export const GetInterminglingResponse: MessageFns = { + encode(message: GetInterminglingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + Intermingling.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetInterminglingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetInterminglingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = Intermingling.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetInterminglingResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? Intermingling.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: GetInterminglingResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = Intermingling.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): GetInterminglingResponse { + return GetInterminglingResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetInterminglingResponse { + const message = createBaseGetInterminglingResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? Intermingling.fromPartial(object.data) + : undefined; + return message; + }, +}; + +function createBaseUpdateInterminglingRequest(): UpdateInterminglingRequest { + return { intmId: "", intmName: undefined, intmCostPerKg: undefined, notes: undefined, isActive: undefined }; +} + +export const UpdateInterminglingRequest: MessageFns = { + encode(message: UpdateInterminglingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.intmId !== "") { + writer.uint32(10).string(message.intmId); + } + if (message.intmName !== undefined) { + writer.uint32(18).string(message.intmName); + } + if (message.intmCostPerKg !== undefined) { + writer.uint32(25).double(message.intmCostPerKg); + } + if (message.notes !== undefined) { + writer.uint32(34).string(message.notes); + } + if (message.isActive !== undefined) { + writer.uint32(40).bool(message.isActive); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateInterminglingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateInterminglingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.intmId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.intmName = reader.string(); + continue; + } + case 3: { + if (tag !== 25) { + break; + } + + message.intmCostPerKg = reader.double(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.notes = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.isActive = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateInterminglingRequest { + return { + intmId: isSet(object.intmId) + ? globalThis.String(object.intmId) + : isSet(object.intm_id) + ? globalThis.String(object.intm_id) + : "", + intmName: isSet(object.intmName) + ? globalThis.String(object.intmName) + : isSet(object.intm_name) + ? globalThis.String(object.intm_name) + : undefined, + intmCostPerKg: isSet(object.intmCostPerKg) + ? globalThis.Number(object.intmCostPerKg) + : isSet(object.intm_cost_per_kg) + ? globalThis.Number(object.intm_cost_per_kg) + : undefined, + notes: isSet(object.notes) ? globalThis.String(object.notes) : undefined, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : undefined, + }; + }, + + toJSON(message: UpdateInterminglingRequest): unknown { + const obj: any = {}; + if (message.intmId !== "") { + obj.intmId = message.intmId; + } + if (message.intmName !== undefined) { + obj.intmName = message.intmName; + } + if (message.intmCostPerKg !== undefined) { + obj.intmCostPerKg = message.intmCostPerKg; + } + if (message.notes !== undefined) { + obj.notes = message.notes; + } + if (message.isActive !== undefined) { + obj.isActive = message.isActive; + } + return obj; + }, + + create(base?: DeepPartial): UpdateInterminglingRequest { + return UpdateInterminglingRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateInterminglingRequest { + const message = createBaseUpdateInterminglingRequest(); + message.intmId = object.intmId ?? ""; + message.intmName = object.intmName ?? undefined; + message.intmCostPerKg = object.intmCostPerKg ?? undefined; + message.notes = object.notes ?? undefined; + message.isActive = object.isActive ?? undefined; + return message; + }, +}; + +function createBaseUpdateInterminglingResponse(): UpdateInterminglingResponse { + return { base: undefined, data: undefined }; +} + +export const UpdateInterminglingResponse: MessageFns = { + encode(message: UpdateInterminglingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + Intermingling.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateInterminglingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateInterminglingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = Intermingling.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateInterminglingResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? Intermingling.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: UpdateInterminglingResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = Intermingling.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): UpdateInterminglingResponse { + return UpdateInterminglingResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateInterminglingResponse { + const message = createBaseUpdateInterminglingResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? Intermingling.fromPartial(object.data) + : undefined; + return message; + }, +}; + +function createBaseDeleteInterminglingRequest(): DeleteInterminglingRequest { + return { intmId: "" }; +} + +export const DeleteInterminglingRequest: MessageFns = { + encode(message: DeleteInterminglingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.intmId !== "") { + writer.uint32(10).string(message.intmId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteInterminglingRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteInterminglingRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.intmId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteInterminglingRequest { + return { + intmId: isSet(object.intmId) + ? globalThis.String(object.intmId) + : isSet(object.intm_id) + ? globalThis.String(object.intm_id) + : "", + }; + }, + + toJSON(message: DeleteInterminglingRequest): unknown { + const obj: any = {}; + if (message.intmId !== "") { + obj.intmId = message.intmId; + } + return obj; + }, + + create(base?: DeepPartial): DeleteInterminglingRequest { + return DeleteInterminglingRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteInterminglingRequest { + const message = createBaseDeleteInterminglingRequest(); + message.intmId = object.intmId ?? ""; + return message; + }, +}; + +function createBaseDeleteInterminglingResponse(): DeleteInterminglingResponse { + return { base: undefined }; +} + +export const DeleteInterminglingResponse: MessageFns = { + encode(message: DeleteInterminglingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteInterminglingResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteInterminglingResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteInterminglingResponse { + return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; + }, + + toJSON(message: DeleteInterminglingResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + return obj; + }, + + create(base?: DeepPartial): DeleteInterminglingResponse { + return DeleteInterminglingResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteInterminglingResponse { + const message = createBaseDeleteInterminglingResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + return message; + }, +}; + +function createBaseListInterminglingsRequest(): ListInterminglingsRequest { + return { page: 0, pageSize: 0, search: "", activeFilter: 0, sortBy: "", sortOrder: "" }; +} + +export const ListInterminglingsRequest: MessageFns = { + encode(message: ListInterminglingsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.page !== 0) { + writer.uint32(8).int32(message.page); + } + if (message.pageSize !== 0) { + writer.uint32(16).int32(message.pageSize); + } + if (message.search !== "") { + writer.uint32(26).string(message.search); + } + if (message.activeFilter !== 0) { + writer.uint32(32).int32(message.activeFilter); + } + if (message.sortBy !== "") { + writer.uint32(42).string(message.sortBy); + } + if (message.sortOrder !== "") { + writer.uint32(50).string(message.sortOrder); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListInterminglingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListInterminglingsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.page = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.pageSize = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.search = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.activeFilter = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.sortBy = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.sortOrder = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListInterminglingsRequest { + return { + page: isSet(object.page) ? globalThis.Number(object.page) : 0, + pageSize: isSet(object.pageSize) + ? globalThis.Number(object.pageSize) + : isSet(object.page_size) + ? globalThis.Number(object.page_size) + : 0, + search: isSet(object.search) ? globalThis.String(object.search) : "", + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, + sortBy: isSet(object.sortBy) + ? globalThis.String(object.sortBy) + : isSet(object.sort_by) + ? globalThis.String(object.sort_by) + : "", + sortOrder: isSet(object.sortOrder) + ? globalThis.String(object.sortOrder) + : isSet(object.sort_order) + ? globalThis.String(object.sort_order) + : "", + }; + }, + + toJSON(message: ListInterminglingsRequest): unknown { + const obj: any = {}; + if (message.page !== 0) { + obj.page = Math.round(message.page); + } + if (message.pageSize !== 0) { + obj.pageSize = Math.round(message.pageSize); + } + if (message.search !== "") { + obj.search = message.search; + } + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); + } + if (message.sortBy !== "") { + obj.sortBy = message.sortBy; + } + if (message.sortOrder !== "") { + obj.sortOrder = message.sortOrder; + } + return obj; + }, + + create(base?: DeepPartial): ListInterminglingsRequest { + return ListInterminglingsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListInterminglingsRequest { + const message = createBaseListInterminglingsRequest(); + message.page = object.page ?? 0; + message.pageSize = object.pageSize ?? 0; + message.search = object.search ?? ""; + message.activeFilter = object.activeFilter ?? 0; + message.sortBy = object.sortBy ?? ""; + message.sortOrder = object.sortOrder ?? ""; + return message; + }, +}; + +function createBaseListInterminglingsResponse(): ListInterminglingsResponse { + return { base: undefined, data: [], pagination: undefined }; +} + +export const ListInterminglingsResponse: MessageFns = { + encode(message: ListInterminglingsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + for (const v of message.data) { + Intermingling.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.pagination !== undefined) { + PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListInterminglingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListInterminglingsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data.push(Intermingling.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pagination = PaginationResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListInterminglingsResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => Intermingling.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: ListInterminglingsResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data?.length) { + obj.data = message.data.map((e) => Intermingling.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PaginationResponse.toJSON(message.pagination); + } + return obj; + }, + + create(base?: DeepPartial): ListInterminglingsResponse { + return ListInterminglingsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListInterminglingsResponse { + const message = createBaseListInterminglingsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = object.data?.map((e) => Intermingling.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PaginationResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseExportInterminglingsRequest(): ExportInterminglingsRequest { + return { activeFilter: 0 }; +} + +export const ExportInterminglingsRequest: MessageFns = { + encode(message: ExportInterminglingsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.activeFilter !== 0) { + writer.uint32(8).int32(message.activeFilter); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExportInterminglingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExportInterminglingsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.activeFilter = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExportInterminglingsRequest { + return { + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, + }; + }, + + toJSON(message: ExportInterminglingsRequest): unknown { + const obj: any = {}; + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); + } + return obj; + }, + + create(base?: DeepPartial): ExportInterminglingsRequest { + return ExportInterminglingsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExportInterminglingsRequest { + const message = createBaseExportInterminglingsRequest(); + message.activeFilter = object.activeFilter ?? 0; + return message; + }, +}; + +function createBaseExportInterminglingsResponse(): ExportInterminglingsResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +} + +export const ExportInterminglingsResponse: MessageFns = { + encode(message: ExportInterminglingsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExportInterminglingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExportInterminglingsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExportInterminglingsResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + }; + }, + + toJSON(message: ExportInterminglingsResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + return obj; + }, + + create(base?: DeepPartial): ExportInterminglingsResponse { + return ExportInterminglingsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExportInterminglingsResponse { + const message = createBaseExportInterminglingsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + return message; + }, +}; + +function createBaseImportInterminglingsRequest(): ImportInterminglingsRequest { + return { fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; +} + +export const ImportInterminglingsRequest: MessageFns = { + encode(message: ImportInterminglingsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.fileContent.length !== 0) { + writer.uint32(10).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(18).string(message.fileName); + } + if (message.duplicateAction !== "") { + writer.uint32(26).string(message.duplicateAction); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ImportInterminglingsRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseImportInterminglingsRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.duplicateAction = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ImportInterminglingsRequest { + return { + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + duplicateAction: isSet(object.duplicateAction) + ? globalThis.String(object.duplicateAction) + : isSet(object.duplicate_action) + ? globalThis.String(object.duplicate_action) + : "", + }; + }, + + toJSON(message: ImportInterminglingsRequest): unknown { + const obj: any = {}; + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + if (message.duplicateAction !== "") { + obj.duplicateAction = message.duplicateAction; + } + return obj; + }, + + create(base?: DeepPartial): ImportInterminglingsRequest { + return ImportInterminglingsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ImportInterminglingsRequest { + const message = createBaseImportInterminglingsRequest(); + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + message.duplicateAction = object.duplicateAction ?? ""; + return message; + }, +}; + +function createBaseImportInterminglingsResponse(): ImportInterminglingsResponse { + return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; +} + +export const ImportInterminglingsResponse: MessageFns = { + encode(message: ImportInterminglingsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.successCount !== 0) { + writer.uint32(16).int32(message.successCount); + } + if (message.skippedCount !== 0) { + writer.uint32(24).int32(message.skippedCount); + } + if (message.failedCount !== 0) { + writer.uint32(32).int32(message.failedCount); + } + for (const v of message.errors) { + ImportError.encode(v!, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ImportInterminglingsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseImportInterminglingsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.successCount = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.skippedCount = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.failedCount = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.errors.push(ImportError.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ImportInterminglingsResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + successCount: isSet(object.successCount) + ? globalThis.Number(object.successCount) + : isSet(object.success_count) + ? globalThis.Number(object.success_count) + : 0, + skippedCount: isSet(object.skippedCount) + ? globalThis.Number(object.skippedCount) + : isSet(object.skipped_count) + ? globalThis.Number(object.skipped_count) + : 0, + failedCount: isSet(object.failedCount) + ? globalThis.Number(object.failedCount) + : isSet(object.failed_count) + ? globalThis.Number(object.failed_count) + : 0, + errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => ImportError.fromJSON(e)) : [], + }; + }, + + toJSON(message: ImportInterminglingsResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.successCount !== 0) { + obj.successCount = Math.round(message.successCount); + } + if (message.skippedCount !== 0) { + obj.skippedCount = Math.round(message.skippedCount); + } + if (message.failedCount !== 0) { + obj.failedCount = Math.round(message.failedCount); + } + if (message.errors?.length) { + obj.errors = message.errors.map((e) => ImportError.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ImportInterminglingsResponse { + return ImportInterminglingsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ImportInterminglingsResponse { + const message = createBaseImportInterminglingsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.successCount = object.successCount ?? 0; + message.skippedCount = object.skippedCount ?? 0; + message.failedCount = object.failedCount ?? 0; + message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDownloadInterminglingTemplateRequest(): DownloadInterminglingTemplateRequest { + return {}; +} + +export const DownloadInterminglingTemplateRequest: MessageFns = { + encode(_: DownloadInterminglingTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DownloadInterminglingTemplateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDownloadInterminglingTemplateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): DownloadInterminglingTemplateRequest { + return {}; + }, + + toJSON(_: DownloadInterminglingTemplateRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): DownloadInterminglingTemplateRequest { + return DownloadInterminglingTemplateRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): DownloadInterminglingTemplateRequest { + const message = createBaseDownloadInterminglingTemplateRequest(); + return message; + }, +}; + +function createBaseDownloadInterminglingTemplateResponse(): DownloadInterminglingTemplateResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +} + +export const DownloadInterminglingTemplateResponse: MessageFns = { + encode(message: DownloadInterminglingTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DownloadInterminglingTemplateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDownloadInterminglingTemplateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DownloadInterminglingTemplateResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + }; + }, + + toJSON(message: DownloadInterminglingTemplateResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + return obj; + }, + + create(base?: DeepPartial): DownloadInterminglingTemplateResponse { + return DownloadInterminglingTemplateResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DownloadInterminglingTemplateResponse { + const message = createBaseDownloadInterminglingTemplateResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + return message; + }, +}; + +function createBaseProductGrade(): ProductGrade { + return { + pgId: "", + pgCode: "", + pgName: "", + pgDescription: "", + bcPerc: 0, + nonStdPerc: 0, + bcRecoveryRate: 0, + isActive: false, + notes: "", + pgDetailProduct: "", + pgGradeLabel: "", + stdSellingPrice: 0, + spValue: 0, + lossPct: undefined, + seqNo: undefined, + audit: undefined, + }; +} + +export const ProductGrade: MessageFns = { + encode(message: ProductGrade, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pgId !== "") { + writer.uint32(10).string(message.pgId); + } + if (message.pgCode !== "") { + writer.uint32(18).string(message.pgCode); + } + if (message.pgName !== "") { + writer.uint32(26).string(message.pgName); + } + if (message.pgDescription !== "") { + writer.uint32(34).string(message.pgDescription); + } + if (message.bcPerc !== 0) { + writer.uint32(41).double(message.bcPerc); + } + if (message.nonStdPerc !== 0) { + writer.uint32(49).double(message.nonStdPerc); + } + if (message.bcRecoveryRate !== 0) { + writer.uint32(57).double(message.bcRecoveryRate); + } + if (message.isActive !== false) { + writer.uint32(64).bool(message.isActive); + } + if (message.notes !== "") { + writer.uint32(74).string(message.notes); + } + if (message.pgDetailProduct !== "") { + writer.uint32(82).string(message.pgDetailProduct); + } + if (message.pgGradeLabel !== "") { + writer.uint32(90).string(message.pgGradeLabel); + } + if (message.stdSellingPrice !== 0) { + writer.uint32(97).double(message.stdSellingPrice); + } + if (message.spValue !== 0) { + writer.uint32(105).double(message.spValue); + } + if (message.lossPct !== undefined) { + writer.uint32(113).double(message.lossPct); + } + if (message.seqNo !== undefined) { + writer.uint32(120).int32(message.seqNo); + } + if (message.audit !== undefined) { + AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ProductGrade { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProductGrade(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.pgId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.pgCode = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pgName = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.pgDescription = reader.string(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.bcPerc = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.nonStdPerc = reader.double(); + continue; + } + case 7: { + if (tag !== 57) { + break; + } + + message.bcRecoveryRate = reader.double(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.isActive = reader.bool(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.notes = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.pgDetailProduct = reader.string(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.pgGradeLabel = reader.string(); + continue; + } + case 12: { + if (tag !== 97) { + break; + } + + message.stdSellingPrice = reader.double(); + continue; + } + case 13: { + if (tag !== 105) { + break; + } + + message.spValue = reader.double(); + continue; + } + case 14: { + if (tag !== 113) { + break; + } + + message.lossPct = reader.double(); + continue; + } + case 15: { + if (tag !== 120) { + break; + } + + message.seqNo = reader.int32(); + continue; + } + case 16: { + if (tag !== 130) { + break; + } + + message.audit = AuditInfo.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ProductGrade { + return { + pgId: isSet(object.pgId) + ? globalThis.String(object.pgId) + : isSet(object.pg_id) + ? globalThis.String(object.pg_id) + : "", + pgCode: isSet(object.pgCode) + ? globalThis.String(object.pgCode) + : isSet(object.pg_code) + ? globalThis.String(object.pg_code) + : "", + pgName: isSet(object.pgName) + ? globalThis.String(object.pgName) + : isSet(object.pg_name) + ? globalThis.String(object.pg_name) + : "", + pgDescription: isSet(object.pgDescription) + ? globalThis.String(object.pgDescription) + : isSet(object.pg_description) + ? globalThis.String(object.pg_description) + : "", + bcPerc: isSet(object.bcPerc) + ? globalThis.Number(object.bcPerc) + : isSet(object.bc_perc) + ? globalThis.Number(object.bc_perc) + : 0, + nonStdPerc: isSet(object.nonStdPerc) + ? globalThis.Number(object.nonStdPerc) + : isSet(object.non_std_perc) + ? globalThis.Number(object.non_std_perc) + : 0, + bcRecoveryRate: isSet(object.bcRecoveryRate) + ? globalThis.Number(object.bcRecoveryRate) + : isSet(object.bc_recovery_rate) + ? globalThis.Number(object.bc_recovery_rate) + : 0, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, + notes: isSet(object.notes) ? globalThis.String(object.notes) : "", + pgDetailProduct: isSet(object.pgDetailProduct) + ? globalThis.String(object.pgDetailProduct) + : isSet(object.pg_detail_product) + ? globalThis.String(object.pg_detail_product) + : "", + pgGradeLabel: isSet(object.pgGradeLabel) + ? globalThis.String(object.pgGradeLabel) + : isSet(object.pg_grade_label) + ? globalThis.String(object.pg_grade_label) + : "", + stdSellingPrice: isSet(object.stdSellingPrice) + ? globalThis.Number(object.stdSellingPrice) + : isSet(object.std_selling_price) + ? globalThis.Number(object.std_selling_price) + : 0, + spValue: isSet(object.spValue) + ? globalThis.Number(object.spValue) + : isSet(object.sp_value) + ? globalThis.Number(object.sp_value) + : 0, + lossPct: isSet(object.lossPct) + ? globalThis.Number(object.lossPct) + : isSet(object.loss_pct) + ? globalThis.Number(object.loss_pct) + : undefined, + seqNo: isSet(object.seqNo) + ? globalThis.Number(object.seqNo) + : isSet(object.seq_no) + ? globalThis.Number(object.seq_no) + : undefined, + audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, + }; + }, + + toJSON(message: ProductGrade): unknown { + const obj: any = {}; + if (message.pgId !== "") { + obj.pgId = message.pgId; + } + if (message.pgCode !== "") { + obj.pgCode = message.pgCode; + } + if (message.pgName !== "") { + obj.pgName = message.pgName; + } + if (message.pgDescription !== "") { + obj.pgDescription = message.pgDescription; + } + if (message.bcPerc !== 0) { + obj.bcPerc = message.bcPerc; + } + if (message.nonStdPerc !== 0) { + obj.nonStdPerc = message.nonStdPerc; + } + if (message.bcRecoveryRate !== 0) { + obj.bcRecoveryRate = message.bcRecoveryRate; + } + if (message.isActive !== false) { + obj.isActive = message.isActive; + } + if (message.notes !== "") { + obj.notes = message.notes; + } + if (message.pgDetailProduct !== "") { + obj.pgDetailProduct = message.pgDetailProduct; + } + if (message.pgGradeLabel !== "") { + obj.pgGradeLabel = message.pgGradeLabel; + } + if (message.stdSellingPrice !== 0) { + obj.stdSellingPrice = message.stdSellingPrice; + } + if (message.spValue !== 0) { + obj.spValue = message.spValue; + } + if (message.lossPct !== undefined) { + obj.lossPct = message.lossPct; + } + if (message.seqNo !== undefined) { + obj.seqNo = Math.round(message.seqNo); + } + if (message.audit !== undefined) { + obj.audit = AuditInfo.toJSON(message.audit); + } + return obj; + }, + + create(base?: DeepPartial): ProductGrade { + return ProductGrade.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ProductGrade { + const message = createBaseProductGrade(); + message.pgId = object.pgId ?? ""; + message.pgCode = object.pgCode ?? ""; + message.pgName = object.pgName ?? ""; + message.pgDescription = object.pgDescription ?? ""; + message.bcPerc = object.bcPerc ?? 0; + message.nonStdPerc = object.nonStdPerc ?? 0; + message.bcRecoveryRate = object.bcRecoveryRate ?? 0; + message.isActive = object.isActive ?? false; + message.notes = object.notes ?? ""; + message.pgDetailProduct = object.pgDetailProduct ?? ""; + message.pgGradeLabel = object.pgGradeLabel ?? ""; + message.stdSellingPrice = object.stdSellingPrice ?? 0; + message.spValue = object.spValue ?? 0; + message.lossPct = object.lossPct ?? undefined; + message.seqNo = object.seqNo ?? undefined; + message.audit = (object.audit !== undefined && object.audit !== null) + ? AuditInfo.fromPartial(object.audit) + : undefined; + return message; + }, +}; + +function createBaseCreateProductGradeRequest(): CreateProductGradeRequest { + return { + pgCode: "", + pgName: "", + pgDescription: "", + bcPerc: 0, + nonStdPerc: 0, + bcRecoveryRate: 0, + notes: "", + pgDetailProduct: "", + pgGradeLabel: "", + stdSellingPrice: 0, + spValue: 0, + lossPct: undefined, + seqNo: undefined, + }; +} + +export const CreateProductGradeRequest: MessageFns = { + encode(message: CreateProductGradeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pgCode !== "") { + writer.uint32(10).string(message.pgCode); + } + if (message.pgName !== "") { + writer.uint32(18).string(message.pgName); + } + if (message.pgDescription !== "") { + writer.uint32(26).string(message.pgDescription); + } + if (message.bcPerc !== 0) { + writer.uint32(33).double(message.bcPerc); + } + if (message.nonStdPerc !== 0) { + writer.uint32(41).double(message.nonStdPerc); + } + if (message.bcRecoveryRate !== 0) { + writer.uint32(49).double(message.bcRecoveryRate); + } + if (message.notes !== "") { + writer.uint32(58).string(message.notes); + } + if (message.pgDetailProduct !== "") { + writer.uint32(66).string(message.pgDetailProduct); + } + if (message.pgGradeLabel !== "") { + writer.uint32(74).string(message.pgGradeLabel); + } + if (message.stdSellingPrice !== 0) { + writer.uint32(81).double(message.stdSellingPrice); + } + if (message.spValue !== 0) { + writer.uint32(89).double(message.spValue); + } + if (message.lossPct !== undefined) { + writer.uint32(97).double(message.lossPct); + } + if (message.seqNo !== undefined) { + writer.uint32(104).int32(message.seqNo); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateProductGradeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateProductGradeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.pgCode = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.pgName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pgDescription = reader.string(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.bcPerc = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.nonStdPerc = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.bcRecoveryRate = reader.double(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.notes = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.pgDetailProduct = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.pgGradeLabel = reader.string(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } + + message.stdSellingPrice = reader.double(); + continue; + } + case 11: { + if (tag !== 89) { + break; + } + + message.spValue = reader.double(); + continue; + } + case 12: { + if (tag !== 97) { + break; + } + + message.lossPct = reader.double(); + continue; + } + case 13: { + if (tag !== 104) { + break; + } + + message.seqNo = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CreateProductGradeRequest { + return { + pgCode: isSet(object.pgCode) + ? globalThis.String(object.pgCode) + : isSet(object.pg_code) + ? globalThis.String(object.pg_code) + : "", + pgName: isSet(object.pgName) + ? globalThis.String(object.pgName) + : isSet(object.pg_name) + ? globalThis.String(object.pg_name) + : "", + pgDescription: isSet(object.pgDescription) + ? globalThis.String(object.pgDescription) + : isSet(object.pg_description) + ? globalThis.String(object.pg_description) + : "", + bcPerc: isSet(object.bcPerc) + ? globalThis.Number(object.bcPerc) + : isSet(object.bc_perc) + ? globalThis.Number(object.bc_perc) + : 0, + nonStdPerc: isSet(object.nonStdPerc) + ? globalThis.Number(object.nonStdPerc) + : isSet(object.non_std_perc) + ? globalThis.Number(object.non_std_perc) + : 0, + bcRecoveryRate: isSet(object.bcRecoveryRate) + ? globalThis.Number(object.bcRecoveryRate) + : isSet(object.bc_recovery_rate) + ? globalThis.Number(object.bc_recovery_rate) + : 0, + notes: isSet(object.notes) ? globalThis.String(object.notes) : "", + pgDetailProduct: isSet(object.pgDetailProduct) + ? globalThis.String(object.pgDetailProduct) + : isSet(object.pg_detail_product) + ? globalThis.String(object.pg_detail_product) + : "", + pgGradeLabel: isSet(object.pgGradeLabel) + ? globalThis.String(object.pgGradeLabel) + : isSet(object.pg_grade_label) + ? globalThis.String(object.pg_grade_label) + : "", + stdSellingPrice: isSet(object.stdSellingPrice) + ? globalThis.Number(object.stdSellingPrice) + : isSet(object.std_selling_price) + ? globalThis.Number(object.std_selling_price) + : 0, + spValue: isSet(object.spValue) + ? globalThis.Number(object.spValue) + : isSet(object.sp_value) + ? globalThis.Number(object.sp_value) + : 0, + lossPct: isSet(object.lossPct) + ? globalThis.Number(object.lossPct) + : isSet(object.loss_pct) + ? globalThis.Number(object.loss_pct) + : undefined, + seqNo: isSet(object.seqNo) + ? globalThis.Number(object.seqNo) + : isSet(object.seq_no) + ? globalThis.Number(object.seq_no) + : undefined, + }; + }, + + toJSON(message: CreateProductGradeRequest): unknown { + const obj: any = {}; + if (message.pgCode !== "") { + obj.pgCode = message.pgCode; + } + if (message.pgName !== "") { + obj.pgName = message.pgName; + } + if (message.pgDescription !== "") { + obj.pgDescription = message.pgDescription; + } + if (message.bcPerc !== 0) { + obj.bcPerc = message.bcPerc; + } + if (message.nonStdPerc !== 0) { + obj.nonStdPerc = message.nonStdPerc; + } + if (message.bcRecoveryRate !== 0) { + obj.bcRecoveryRate = message.bcRecoveryRate; + } + if (message.notes !== "") { + obj.notes = message.notes; + } + if (message.pgDetailProduct !== "") { + obj.pgDetailProduct = message.pgDetailProduct; + } + if (message.pgGradeLabel !== "") { + obj.pgGradeLabel = message.pgGradeLabel; + } + if (message.stdSellingPrice !== 0) { + obj.stdSellingPrice = message.stdSellingPrice; + } + if (message.spValue !== 0) { + obj.spValue = message.spValue; + } + if (message.lossPct !== undefined) { + obj.lossPct = message.lossPct; + } + if (message.seqNo !== undefined) { + obj.seqNo = Math.round(message.seqNo); + } + return obj; + }, + + create(base?: DeepPartial): CreateProductGradeRequest { + return CreateProductGradeRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateProductGradeRequest { + const message = createBaseCreateProductGradeRequest(); + message.pgCode = object.pgCode ?? ""; + message.pgName = object.pgName ?? ""; + message.pgDescription = object.pgDescription ?? ""; + message.bcPerc = object.bcPerc ?? 0; + message.nonStdPerc = object.nonStdPerc ?? 0; + message.bcRecoveryRate = object.bcRecoveryRate ?? 0; + message.notes = object.notes ?? ""; + message.pgDetailProduct = object.pgDetailProduct ?? ""; + message.pgGradeLabel = object.pgGradeLabel ?? ""; + message.stdSellingPrice = object.stdSellingPrice ?? 0; + message.spValue = object.spValue ?? 0; + message.lossPct = object.lossPct ?? undefined; + message.seqNo = object.seqNo ?? undefined; + return message; + }, +}; + +function createBaseCreateProductGradeResponse(): CreateProductGradeResponse { + return { base: undefined, data: undefined }; +} + +export const CreateProductGradeResponse: MessageFns = { + encode(message: CreateProductGradeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + ProductGrade.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateProductGradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateProductGradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = ProductGrade.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): CreateProductGradeResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? ProductGrade.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: CreateProductGradeResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = ProductGrade.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): CreateProductGradeResponse { + return CreateProductGradeResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateProductGradeResponse { + const message = createBaseCreateProductGradeResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? ProductGrade.fromPartial(object.data) + : undefined; + return message; + }, +}; + +function createBaseGetProductGradeRequest(): GetProductGradeRequest { + return { pgId: "" }; +} + +export const GetProductGradeRequest: MessageFns = { + encode(message: GetProductGradeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pgId !== "") { + writer.uint32(10).string(message.pgId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetProductGradeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetProductGradeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.pgId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetProductGradeRequest { + return { + pgId: isSet(object.pgId) + ? globalThis.String(object.pgId) + : isSet(object.pg_id) + ? globalThis.String(object.pg_id) + : "", + }; + }, + + toJSON(message: GetProductGradeRequest): unknown { + const obj: any = {}; + if (message.pgId !== "") { + obj.pgId = message.pgId; + } + return obj; + }, + + create(base?: DeepPartial): GetProductGradeRequest { + return GetProductGradeRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetProductGradeRequest { + const message = createBaseGetProductGradeRequest(); + message.pgId = object.pgId ?? ""; + return message; + }, +}; + +function createBaseGetProductGradeResponse(): GetProductGradeResponse { + return { base: undefined, data: undefined }; +} + +export const GetProductGradeResponse: MessageFns = { + encode(message: GetProductGradeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + ProductGrade.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetProductGradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetProductGradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = ProductGrade.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetProductGradeResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? ProductGrade.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: GetProductGradeResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = ProductGrade.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): GetProductGradeResponse { + return GetProductGradeResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): GetProductGradeResponse { + const message = createBaseGetProductGradeResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? ProductGrade.fromPartial(object.data) + : undefined; + return message; + }, +}; + +function createBaseUpdateProductGradeRequest(): UpdateProductGradeRequest { + return { + pgId: "", + pgName: undefined, + pgDescription: undefined, + bcPerc: undefined, + nonStdPerc: undefined, + bcRecoveryRate: undefined, + notes: undefined, + isActive: undefined, + pgDetailProduct: undefined, + pgGradeLabel: undefined, + stdSellingPrice: undefined, + spValue: undefined, + lossPct: undefined, + seqNo: undefined, + }; +} + +export const UpdateProductGradeRequest: MessageFns = { + encode(message: UpdateProductGradeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pgId !== "") { + writer.uint32(10).string(message.pgId); + } + if (message.pgName !== undefined) { + writer.uint32(18).string(message.pgName); + } + if (message.pgDescription !== undefined) { + writer.uint32(26).string(message.pgDescription); + } + if (message.bcPerc !== undefined) { + writer.uint32(33).double(message.bcPerc); + } + if (message.nonStdPerc !== undefined) { + writer.uint32(41).double(message.nonStdPerc); + } + if (message.bcRecoveryRate !== undefined) { + writer.uint32(49).double(message.bcRecoveryRate); + } + if (message.notes !== undefined) { + writer.uint32(58).string(message.notes); + } + if (message.isActive !== undefined) { + writer.uint32(64).bool(message.isActive); + } + if (message.pgDetailProduct !== undefined) { + writer.uint32(74).string(message.pgDetailProduct); + } + if (message.pgGradeLabel !== undefined) { + writer.uint32(82).string(message.pgGradeLabel); + } + if (message.stdSellingPrice !== undefined) { + writer.uint32(89).double(message.stdSellingPrice); + } + if (message.spValue !== undefined) { + writer.uint32(97).double(message.spValue); + } + if (message.lossPct !== undefined) { + writer.uint32(105).double(message.lossPct); + } + if (message.seqNo !== undefined) { + writer.uint32(112).int32(message.seqNo); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateProductGradeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateProductGradeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.pgId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.pgName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pgDescription = reader.string(); + continue; + } + case 4: { + if (tag !== 33) { + break; + } + + message.bcPerc = reader.double(); + continue; + } + case 5: { + if (tag !== 41) { + break; + } + + message.nonStdPerc = reader.double(); + continue; + } + case 6: { + if (tag !== 49) { + break; + } + + message.bcRecoveryRate = reader.double(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.notes = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.isActive = reader.bool(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.pgDetailProduct = reader.string(); + continue; + } + case 10: { + if (tag !== 82) { + break; + } + + message.pgGradeLabel = reader.string(); + continue; + } + case 11: { + if (tag !== 89) { + break; + } + + message.stdSellingPrice = reader.double(); + continue; + } + case 12: { + if (tag !== 97) { + break; + } + + message.spValue = reader.double(); + continue; + } + case 13: { + if (tag !== 105) { + break; + } + + message.lossPct = reader.double(); + continue; + } + case 14: { + if (tag !== 112) { + break; + } + + message.seqNo = reader.int32(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateProductGradeRequest { + return { + pgId: isSet(object.pgId) + ? globalThis.String(object.pgId) + : isSet(object.pg_id) + ? globalThis.String(object.pg_id) + : "", + pgName: isSet(object.pgName) + ? globalThis.String(object.pgName) + : isSet(object.pg_name) + ? globalThis.String(object.pg_name) + : undefined, + pgDescription: isSet(object.pgDescription) + ? globalThis.String(object.pgDescription) + : isSet(object.pg_description) + ? globalThis.String(object.pg_description) + : undefined, + bcPerc: isSet(object.bcPerc) + ? globalThis.Number(object.bcPerc) + : isSet(object.bc_perc) + ? globalThis.Number(object.bc_perc) + : undefined, + nonStdPerc: isSet(object.nonStdPerc) + ? globalThis.Number(object.nonStdPerc) + : isSet(object.non_std_perc) + ? globalThis.Number(object.non_std_perc) + : undefined, + bcRecoveryRate: isSet(object.bcRecoveryRate) + ? globalThis.Number(object.bcRecoveryRate) + : isSet(object.bc_recovery_rate) + ? globalThis.Number(object.bc_recovery_rate) + : undefined, + notes: isSet(object.notes) ? globalThis.String(object.notes) : undefined, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : undefined, + pgDetailProduct: isSet(object.pgDetailProduct) + ? globalThis.String(object.pgDetailProduct) + : isSet(object.pg_detail_product) + ? globalThis.String(object.pg_detail_product) + : undefined, + pgGradeLabel: isSet(object.pgGradeLabel) + ? globalThis.String(object.pgGradeLabel) + : isSet(object.pg_grade_label) + ? globalThis.String(object.pg_grade_label) + : undefined, + stdSellingPrice: isSet(object.stdSellingPrice) + ? globalThis.Number(object.stdSellingPrice) + : isSet(object.std_selling_price) + ? globalThis.Number(object.std_selling_price) + : undefined, + spValue: isSet(object.spValue) + ? globalThis.Number(object.spValue) + : isSet(object.sp_value) + ? globalThis.Number(object.sp_value) + : undefined, + lossPct: isSet(object.lossPct) + ? globalThis.Number(object.lossPct) + : isSet(object.loss_pct) + ? globalThis.Number(object.loss_pct) + : undefined, + seqNo: isSet(object.seqNo) + ? globalThis.Number(object.seqNo) + : isSet(object.seq_no) + ? globalThis.Number(object.seq_no) + : undefined, + }; + }, + + toJSON(message: UpdateProductGradeRequest): unknown { + const obj: any = {}; + if (message.pgId !== "") { + obj.pgId = message.pgId; + } + if (message.pgName !== undefined) { + obj.pgName = message.pgName; + } + if (message.pgDescription !== undefined) { + obj.pgDescription = message.pgDescription; + } + if (message.bcPerc !== undefined) { + obj.bcPerc = message.bcPerc; + } + if (message.nonStdPerc !== undefined) { + obj.nonStdPerc = message.nonStdPerc; + } + if (message.bcRecoveryRate !== undefined) { + obj.bcRecoveryRate = message.bcRecoveryRate; + } + if (message.notes !== undefined) { + obj.notes = message.notes; + } + if (message.isActive !== undefined) { + obj.isActive = message.isActive; + } + if (message.pgDetailProduct !== undefined) { + obj.pgDetailProduct = message.pgDetailProduct; + } + if (message.pgGradeLabel !== undefined) { + obj.pgGradeLabel = message.pgGradeLabel; + } + if (message.stdSellingPrice !== undefined) { + obj.stdSellingPrice = message.stdSellingPrice; + } + if (message.spValue !== undefined) { + obj.spValue = message.spValue; + } + if (message.lossPct !== undefined) { + obj.lossPct = message.lossPct; + } + if (message.seqNo !== undefined) { + obj.seqNo = Math.round(message.seqNo); + } + return obj; + }, + + create(base?: DeepPartial): UpdateProductGradeRequest { + return UpdateProductGradeRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateProductGradeRequest { + const message = createBaseUpdateProductGradeRequest(); + message.pgId = object.pgId ?? ""; + message.pgName = object.pgName ?? undefined; + message.pgDescription = object.pgDescription ?? undefined; + message.bcPerc = object.bcPerc ?? undefined; + message.nonStdPerc = object.nonStdPerc ?? undefined; + message.bcRecoveryRate = object.bcRecoveryRate ?? undefined; + message.notes = object.notes ?? undefined; + message.isActive = object.isActive ?? undefined; + message.pgDetailProduct = object.pgDetailProduct ?? undefined; + message.pgGradeLabel = object.pgGradeLabel ?? undefined; + message.stdSellingPrice = object.stdSellingPrice ?? undefined; + message.spValue = object.spValue ?? undefined; + message.lossPct = object.lossPct ?? undefined; + message.seqNo = object.seqNo ?? undefined; + return message; + }, +}; + +function createBaseUpdateProductGradeResponse(): UpdateProductGradeResponse { + return { base: undefined, data: undefined }; +} + +export const UpdateProductGradeResponse: MessageFns = { + encode(message: UpdateProductGradeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + ProductGrade.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateProductGradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateProductGradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = ProductGrade.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateProductGradeResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? ProductGrade.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: UpdateProductGradeResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = ProductGrade.toJSON(message.data); + } + return obj; + }, + + create(base?: DeepPartial): UpdateProductGradeResponse { + return UpdateProductGradeResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateProductGradeResponse { + const message = createBaseUpdateProductGradeResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? ProductGrade.fromPartial(object.data) + : undefined; + return message; + }, +}; + +function createBaseDeleteProductGradeRequest(): DeleteProductGradeRequest { + return { pgId: "" }; +} + +export const DeleteProductGradeRequest: MessageFns = { + encode(message: DeleteProductGradeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.pgId !== "") { + writer.uint32(10).string(message.pgId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteProductGradeRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteProductGradeRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.pgId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteProductGradeRequest { + return { + pgId: isSet(object.pgId) + ? globalThis.String(object.pgId) + : isSet(object.pg_id) + ? globalThis.String(object.pg_id) + : "", + }; + }, + + toJSON(message: DeleteProductGradeRequest): unknown { + const obj: any = {}; + if (message.pgId !== "") { + obj.pgId = message.pgId; + } + return obj; + }, + + create(base?: DeepPartial): DeleteProductGradeRequest { + return DeleteProductGradeRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteProductGradeRequest { + const message = createBaseDeleteProductGradeRequest(); + message.pgId = object.pgId ?? ""; + return message; + }, +}; + +function createBaseDeleteProductGradeResponse(): DeleteProductGradeResponse { + return { base: undefined }; +} + +export const DeleteProductGradeResponse: MessageFns = { + encode(message: DeleteProductGradeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteProductGradeResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteProductGradeResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DeleteProductGradeResponse { + return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; + }, + + toJSON(message: DeleteProductGradeResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + return obj; + }, + + create(base?: DeepPartial): DeleteProductGradeResponse { + return DeleteProductGradeResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteProductGradeResponse { + const message = createBaseDeleteProductGradeResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + return message; + }, +}; + +function createBaseListProductGradesRequest(): ListProductGradesRequest { + return { page: 0, pageSize: 0, search: "", activeFilter: 0, sortBy: "", sortOrder: "" }; +} + +export const ListProductGradesRequest: MessageFns = { + encode(message: ListProductGradesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.page !== 0) { + writer.uint32(8).int32(message.page); + } + if (message.pageSize !== 0) { + writer.uint32(16).int32(message.pageSize); + } + if (message.search !== "") { + writer.uint32(26).string(message.search); + } + if (message.activeFilter !== 0) { + writer.uint32(32).int32(message.activeFilter); + } + if (message.sortBy !== "") { + writer.uint32(42).string(message.sortBy); + } + if (message.sortOrder !== "") { + writer.uint32(50).string(message.sortOrder); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListProductGradesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListProductGradesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.page = reader.int32(); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.pageSize = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.search = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.activeFilter = reader.int32() as any; + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.sortBy = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.sortOrder = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListProductGradesRequest { + return { + page: isSet(object.page) ? globalThis.Number(object.page) : 0, + pageSize: isSet(object.pageSize) + ? globalThis.Number(object.pageSize) + : isSet(object.page_size) + ? globalThis.Number(object.page_size) + : 0, + search: isSet(object.search) ? globalThis.String(object.search) : "", + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, + sortBy: isSet(object.sortBy) + ? globalThis.String(object.sortBy) + : isSet(object.sort_by) + ? globalThis.String(object.sort_by) + : "", + sortOrder: isSet(object.sortOrder) + ? globalThis.String(object.sortOrder) + : isSet(object.sort_order) + ? globalThis.String(object.sort_order) + : "", + }; + }, + + toJSON(message: ListProductGradesRequest): unknown { + const obj: any = {}; + if (message.page !== 0) { + obj.page = Math.round(message.page); + } + if (message.pageSize !== 0) { + obj.pageSize = Math.round(message.pageSize); + } + if (message.search !== "") { + obj.search = message.search; + } + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); + } + if (message.sortBy !== "") { + obj.sortBy = message.sortBy; + } + if (message.sortOrder !== "") { + obj.sortOrder = message.sortOrder; + } + return obj; + }, + + create(base?: DeepPartial): ListProductGradesRequest { + return ListProductGradesRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListProductGradesRequest { + const message = createBaseListProductGradesRequest(); + message.page = object.page ?? 0; + message.pageSize = object.pageSize ?? 0; + message.search = object.search ?? ""; + message.activeFilter = object.activeFilter ?? 0; + message.sortBy = object.sortBy ?? ""; + message.sortOrder = object.sortOrder ?? ""; + return message; + }, +}; + +function createBaseListProductGradesResponse(): ListProductGradesResponse { + return { base: undefined, data: [], pagination: undefined }; +} + +export const ListProductGradesResponse: MessageFns = { + encode(message: ListProductGradesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + for (const v of message.data) { + ProductGrade.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.pagination !== undefined) { + PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListProductGradesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListProductGradesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data.push(ProductGrade.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pagination = PaginationResponse.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListProductGradesResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => ProductGrade.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, + }; + }, + + toJSON(message: ListProductGradesResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data?.length) { + obj.data = message.data.map((e) => ProductGrade.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PaginationResponse.toJSON(message.pagination); + } + return obj; + }, + + create(base?: DeepPartial): ListProductGradesResponse { + return ListProductGradesResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListProductGradesResponse { + const message = createBaseListProductGradesResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = object.data?.map((e) => ProductGrade.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PaginationResponse.fromPartial(object.pagination) + : undefined; + return message; + }, +}; + +function createBaseExportProductGradesRequest(): ExportProductGradesRequest { + return { activeFilter: 0 }; +} + +export const ExportProductGradesRequest: MessageFns = { + encode(message: ExportProductGradesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.activeFilter !== 0) { + writer.uint32(8).int32(message.activeFilter); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExportProductGradesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExportProductGradesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.activeFilter = reader.int32() as any; + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExportProductGradesRequest { + return { + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, + }; + }, + + toJSON(message: ExportProductGradesRequest): unknown { + const obj: any = {}; + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); + } + return obj; + }, + + create(base?: DeepPartial): ExportProductGradesRequest { + return ExportProductGradesRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExportProductGradesRequest { + const message = createBaseExportProductGradesRequest(); + message.activeFilter = object.activeFilter ?? 0; + return message; + }, +}; + +function createBaseExportProductGradesResponse(): ExportProductGradesResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +} + +export const ExportProductGradesResponse: MessageFns = { + encode(message: ExportProductGradesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ExportProductGradesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExportProductGradesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExportProductGradesResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + }; + }, + + toJSON(message: ExportProductGradesResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + return obj; + }, + + create(base?: DeepPartial): ExportProductGradesResponse { + return ExportProductGradesResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExportProductGradesResponse { + const message = createBaseExportProductGradesResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + return message; + }, +}; + +function createBaseImportProductGradesRequest(): ImportProductGradesRequest { + return { fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; +} + +export const ImportProductGradesRequest: MessageFns = { + encode(message: ImportProductGradesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.fileContent.length !== 0) { + writer.uint32(10).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(18).string(message.fileName); + } + if (message.duplicateAction !== "") { + writer.uint32(26).string(message.duplicateAction); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ImportProductGradesRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseImportProductGradesRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.duplicateAction = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ImportProductGradesRequest { + return { + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + duplicateAction: isSet(object.duplicateAction) + ? globalThis.String(object.duplicateAction) + : isSet(object.duplicate_action) + ? globalThis.String(object.duplicate_action) + : "", + }; + }, + + toJSON(message: ImportProductGradesRequest): unknown { + const obj: any = {}; + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + if (message.duplicateAction !== "") { + obj.duplicateAction = message.duplicateAction; + } + return obj; + }, + + create(base?: DeepPartial): ImportProductGradesRequest { + return ImportProductGradesRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ImportProductGradesRequest { + const message = createBaseImportProductGradesRequest(); + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + message.duplicateAction = object.duplicateAction ?? ""; + return message; + }, +}; + +function createBaseImportProductGradesResponse(): ImportProductGradesResponse { + return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; +} + +export const ImportProductGradesResponse: MessageFns = { + encode(message: ImportProductGradesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.successCount !== 0) { + writer.uint32(16).int32(message.successCount); + } + if (message.skippedCount !== 0) { + writer.uint32(24).int32(message.skippedCount); + } + if (message.failedCount !== 0) { + writer.uint32(32).int32(message.failedCount); + } + for (const v of message.errors) { + ImportError.encode(v!, writer.uint32(42).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ImportProductGradesResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseImportProductGradesResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 16) { + break; + } + + message.successCount = reader.int32(); + continue; + } + case 3: { + if (tag !== 24) { + break; + } + + message.skippedCount = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.failedCount = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.errors.push(ImportError.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ImportProductGradesResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + successCount: isSet(object.successCount) + ? globalThis.Number(object.successCount) + : isSet(object.success_count) + ? globalThis.Number(object.success_count) + : 0, + skippedCount: isSet(object.skippedCount) + ? globalThis.Number(object.skippedCount) + : isSet(object.skipped_count) + ? globalThis.Number(object.skipped_count) + : 0, + failedCount: isSet(object.failedCount) + ? globalThis.Number(object.failedCount) + : isSet(object.failed_count) + ? globalThis.Number(object.failed_count) + : 0, + errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => ImportError.fromJSON(e)) : [], + }; + }, + + toJSON(message: ImportProductGradesResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.successCount !== 0) { + obj.successCount = Math.round(message.successCount); + } + if (message.skippedCount !== 0) { + obj.skippedCount = Math.round(message.skippedCount); + } + if (message.failedCount !== 0) { + obj.failedCount = Math.round(message.failedCount); + } + if (message.errors?.length) { + obj.errors = message.errors.map((e) => ImportError.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ImportProductGradesResponse { + return ImportProductGradesResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ImportProductGradesResponse { + const message = createBaseImportProductGradesResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.successCount = object.successCount ?? 0; + message.skippedCount = object.skippedCount ?? 0; + message.failedCount = object.failedCount ?? 0; + message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDownloadProductGradeTemplateRequest(): DownloadProductGradeTemplateRequest { + return {}; +} + +export const DownloadProductGradeTemplateRequest: MessageFns = { + encode(_: DownloadProductGradeTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DownloadProductGradeTemplateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDownloadProductGradeTemplateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(_: any): DownloadProductGradeTemplateRequest { + return {}; + }, + + toJSON(_: DownloadProductGradeTemplateRequest): unknown { + const obj: any = {}; + return obj; + }, + + create(base?: DeepPartial): DownloadProductGradeTemplateRequest { + return DownloadProductGradeTemplateRequest.fromPartial(base ?? {}); + }, + fromPartial(_: DeepPartial): DownloadProductGradeTemplateRequest { + const message = createBaseDownloadProductGradeTemplateRequest(); + return message; + }, +}; + +function createBaseDownloadProductGradeTemplateResponse(): DownloadProductGradeTemplateResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +} + +export const DownloadProductGradeTemplateResponse: MessageFns = { + encode(message: DownloadProductGradeTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DownloadProductGradeTemplateResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDownloadProductGradeTemplateResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): DownloadProductGradeTemplateResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + }; + }, + + toJSON(message: DownloadProductGradeTemplateResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + return obj; + }, + + create(base?: DeepPartial): DownloadProductGradeTemplateResponse { + return DownloadProductGradeTemplateResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DownloadProductGradeTemplateResponse { + const message = createBaseDownloadProductGradeTemplateResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + return message; + }, +}; + +function createBaseMBHead(): MBHead { + return { + mbhId: "", + mbhOracleSysId: "", + mbhMbCosting: "", + mbhMgtName: "", + mbhDenier: undefined, + mbhFilament: undefined, + mbhDozing: undefined, + mbhIsActive: false, + mbhCheckStatus: undefined, + mbhStatus: undefined, + mbhLdrPrsn: undefined, + mbhFinalProduct: undefined, + mbhCode: undefined, + entryStatus: "", + isBoughtout: false, + audit: undefined, + currentVersion: 0, + machineFixedTotal: "", + stateReason: "", + devCode: "", + shadeCode: "", + shadeName: "", + crossSection: "", + lustureCode: "", + costProductId: 0, + costGeneratedAt: "", + costGeneratedBy: "", + paramWaste: "", + paramQualityLoss: "", + paramEfficiency: "", + paramDevExpense: "", + paramPacking: "", + paramMbProdPerDay: "", + paramThroughputPerHour: "", + paramNoOfProcess: "", + }; +} + +export const MBHead: MessageFns = { + encode(message: MBHead, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); + } + if (message.mbhOracleSysId !== "") { + writer.uint32(18).string(message.mbhOracleSysId); + } + if (message.mbhMbCosting !== "") { + writer.uint32(26).string(message.mbhMbCosting); + } + if (message.mbhMgtName !== "") { + writer.uint32(34).string(message.mbhMgtName); + } + if (message.mbhDenier !== undefined) { + writer.uint32(41).double(message.mbhDenier); + } + if (message.mbhFilament !== undefined) { + writer.uint32(48).int32(message.mbhFilament); + } + if (message.mbhDozing !== undefined) { + writer.uint32(57).double(message.mbhDozing); + } + if (message.mbhIsActive !== false) { + writer.uint32(64).bool(message.mbhIsActive); + } + if (message.mbhCheckStatus !== undefined) { + writer.uint32(74).string(message.mbhCheckStatus); + } + if (message.mbhStatus !== undefined) { + writer.uint32(82).string(message.mbhStatus); + } + if (message.mbhLdrPrsn !== undefined) { + writer.uint32(89).double(message.mbhLdrPrsn); + } + if (message.mbhFinalProduct !== undefined) { + writer.uint32(98).string(message.mbhFinalProduct); + } + if (message.mbhCode !== undefined) { + writer.uint32(106).string(message.mbhCode); + } + if (message.entryStatus !== "") { + writer.uint32(114).string(message.entryStatus); + } + if (message.isBoughtout !== false) { + writer.uint32(120).bool(message.isBoughtout); + } + if (message.audit !== undefined) { + AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); + } + if (message.currentVersion !== 0) { + writer.uint32(136).int32(message.currentVersion); + } + if (message.machineFixedTotal !== "") { + writer.uint32(146).string(message.machineFixedTotal); + } + if (message.stateReason !== "") { + writer.uint32(154).string(message.stateReason); + } + if (message.devCode !== "") { + writer.uint32(162).string(message.devCode); + } + if (message.shadeCode !== "") { + writer.uint32(170).string(message.shadeCode); + } + if (message.shadeName !== "") { + writer.uint32(178).string(message.shadeName); + } + if (message.crossSection !== "") { + writer.uint32(186).string(message.crossSection); + } + if (message.lustureCode !== "") { + writer.uint32(194).string(message.lustureCode); + } + if (message.costProductId !== 0) { + writer.uint32(200).int64(message.costProductId); + } + if (message.costGeneratedAt !== "") { + writer.uint32(210).string(message.costGeneratedAt); + } + if (message.costGeneratedBy !== "") { + writer.uint32(218).string(message.costGeneratedBy); + } + if (message.paramWaste !== "") { + writer.uint32(226).string(message.paramWaste); + } + if (message.paramQualityLoss !== "") { + writer.uint32(234).string(message.paramQualityLoss); + } + if (message.paramEfficiency !== "") { + writer.uint32(242).string(message.paramEfficiency); + } + if (message.paramDevExpense !== "") { + writer.uint32(250).string(message.paramDevExpense); + } + if (message.paramPacking !== "") { + writer.uint32(258).string(message.paramPacking); + } + if (message.paramMbProdPerDay !== "") { + writer.uint32(266).string(message.paramMbProdPerDay); + } + if (message.paramThroughputPerHour !== "") { + writer.uint32(274).string(message.paramThroughputPerHour); + } + if (message.paramNoOfProcess !== "") { + writer.uint32(282).string(message.paramNoOfProcess); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MBHead { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMBHead(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.mbhId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.mbhOracleSysId = reader.string(); continue; } case 3: { @@ -2265,7 +13194,7 @@ export const Machine: MessageFns = { break; } - message.machineName = reader.string(); + message.mbhMbCosting = reader.string(); continue; } case 4: { @@ -2273,15 +13202,15 @@ export const Machine: MessageFns = { break; } - message.mcType = reader.string(); + message.mbhMgtName = reader.string(); continue; } case 5: { - if (tag !== 42) { + if (tag !== 41) { break; } - message.mcLocation = reader.string(); + message.mbhDenier = reader.double(); continue; } case 6: { @@ -2289,39 +13218,39 @@ export const Machine: MessageFns = { break; } - message.noOfPosition = reader.int32(); + message.mbhFilament = reader.int32(); continue; } case 7: { - if (tag !== 56) { + if (tag !== 57) { break; } - message.noOfEnd = reader.int32(); + message.mbhDozing = reader.double(); continue; } case 8: { - if (tag !== 65) { + if (tag !== 64) { break; } - message.mcSpeed = reader.double(); + message.mbhIsActive = reader.bool(); continue; } case 9: { - if (tag !== 73) { + if (tag !== 74) { break; } - message.machineRpm = reader.double(); + message.mbhCheckStatus = reader.string(); continue; } case 10: { - if (tag !== 81) { + if (tag !== 82) { break; } - message.mcEfficiency = reader.double(); + message.mbhStatus = reader.string(); continue; } case 11: { @@ -2329,15 +13258,15 @@ export const Machine: MessageFns = { break; } - message.powerPerDay = reader.double(); + message.mbhLdrPrsn = reader.double(); continue; } case 12: { - if (tag !== 96) { + if (tag !== 98) { break; } - message.isActive = reader.bool(); + message.mbhFinalProduct = reader.string(); continue; } case 13: { @@ -2345,23 +13274,23 @@ export const Machine: MessageFns = { break; } - message.notes = reader.string(); + message.mbhCode = reader.string(); continue; } case 14: { - if (tag !== 113) { + if (tag !== 114) { break; } - message.mpPerDay = reader.double(); + message.entryStatus = reader.string(); continue; } case 15: { - if (tag !== 121) { + if (tag !== 120) { break; } - message.ohsPerDay = reader.double(); + message.isBoughtout = reader.bool(); continue; } case 16: { @@ -2373,510 +13302,580 @@ export const Machine: MessageFns = { continue; } case 17: { - if (tag !== 137) { + if (tag !== 136) { break; } - message.sparesPerDay = reader.double(); + message.currentVersion = reader.int32(); continue; } case 18: { - if (tag !== 145) { + if (tag !== 146) { break; } - message.kgsLostChange = reader.double(); + message.machineFixedTotal = reader.string(); continue; } case 19: { - if (tag !== 153) { + if (tag !== 154) { break; } - message.vb1Qty = reader.double(); + message.stateReason = reader.string(); continue; } case 20: { - if (tag !== 161) { + if (tag !== 162) { break; } - message.vb2Qty = reader.double(); + message.devCode = reader.string(); continue; } case 21: { - if (tag !== 169) { + if (tag !== 170) { break; } - message.vb3Qty = reader.double(); + message.shadeCode = reader.string(); continue; } case 22: { - if (tag !== 177) { + if (tag !== 178) { break; } - message.vb4Qty = reader.double(); + message.shadeName = reader.string(); continue; } case 23: { - if (tag !== 185) { + if (tag !== 186) { break; } - message.vb5Qty = reader.double(); + message.crossSection = reader.string(); continue; } case 24: { - if (tag !== 193) { + if (tag !== 194) { break; } - message.mcPoyBobbinWeight = reader.double(); + message.lustureCode = reader.string(); continue; } case 25: { - if (tag !== 201) { + if (tag !== 200) { break; } - message.mcTotFxdCst = reader.double(); + message.costProductId = longToNumber(reader.int64()); continue; } case 26: { - if (tag !== 209) { + if (tag !== 210) { break; } - message.mcBobbinPerTrolly = reader.double(); + message.costGeneratedAt = reader.string(); continue; } case 27: { - if (tag !== 217) { + if (tag !== 218) { break; } - message.mcBoxCost = reader.double(); + message.costGeneratedBy = reader.string(); continue; } case 28: { - if (tag !== 225) { + if (tag !== 226) { break; } - message.mcCaptivePerBobbin = reader.double(); + message.paramWaste = reader.string(); continue; } case 29: { - if (tag !== 233) { + if (tag !== 234) { break; } - message.mcWeightage = reader.double(); + message.paramQualityLoss = reader.string(); continue; } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, + case 30: { + if (tag !== 242) { + break; + } - fromJSON(object: any): Machine { - return { - machineId: isSet(object.machineId) - ? globalThis.String(object.machineId) - : isSet(object.machine_id) - ? globalThis.String(object.machine_id) - : "", - machineCode: isSet(object.machineCode) - ? globalThis.String(object.machineCode) - : isSet(object.machine_code) - ? globalThis.String(object.machine_code) - : "", - machineName: isSet(object.machineName) - ? globalThis.String(object.machineName) - : isSet(object.machine_name) - ? globalThis.String(object.machine_name) - : "", - mcType: isSet(object.mcType) - ? globalThis.String(object.mcType) - : isSet(object.mc_type) - ? globalThis.String(object.mc_type) - : "", - mcLocation: isSet(object.mcLocation) - ? globalThis.String(object.mcLocation) - : isSet(object.mc_location) - ? globalThis.String(object.mc_location) - : "", - noOfPosition: isSet(object.noOfPosition) - ? globalThis.Number(object.noOfPosition) - : isSet(object.no_of_position) - ? globalThis.Number(object.no_of_position) - : 0, - noOfEnd: isSet(object.noOfEnd) - ? globalThis.Number(object.noOfEnd) - : isSet(object.no_of_end) - ? globalThis.Number(object.no_of_end) - : 0, - mcSpeed: isSet(object.mcSpeed) - ? globalThis.Number(object.mcSpeed) - : isSet(object.mc_speed) - ? globalThis.Number(object.mc_speed) - : 0, - machineRpm: isSet(object.machineRpm) - ? globalThis.Number(object.machineRpm) - : isSet(object.machine_rpm) - ? globalThis.Number(object.machine_rpm) - : undefined, - mcEfficiency: isSet(object.mcEfficiency) - ? globalThis.Number(object.mcEfficiency) - : isSet(object.mc_efficiency) - ? globalThis.Number(object.mc_efficiency) - : 0, - powerPerDay: isSet(object.powerPerDay) - ? globalThis.Number(object.powerPerDay) - : isSet(object.power_per_day) - ? globalThis.Number(object.power_per_day) - : undefined, - isActive: isSet(object.isActive) - ? globalThis.Boolean(object.isActive) - : isSet(object.is_active) - ? globalThis.Boolean(object.is_active) - : false, - notes: isSet(object.notes) ? globalThis.String(object.notes) : "", - mpPerDay: isSet(object.mpPerDay) - ? globalThis.Number(object.mpPerDay) - : isSet(object.mp_per_day) - ? globalThis.Number(object.mp_per_day) - : undefined, - ohsPerDay: isSet(object.ohsPerDay) - ? globalThis.Number(object.ohsPerDay) - : isSet(object.ohs_per_day) - ? globalThis.Number(object.ohs_per_day) - : undefined, - audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, - sparesPerDay: isSet(object.sparesPerDay) - ? globalThis.Number(object.sparesPerDay) - : isSet(object.spares_per_day) - ? globalThis.Number(object.spares_per_day) - : undefined, - kgsLostChange: isSet(object.kgsLostChange) - ? globalThis.Number(object.kgsLostChange) - : isSet(object.kgs_lost_change) - ? globalThis.Number(object.kgs_lost_change) - : undefined, - vb1Qty: isSet(object.vb1Qty) - ? globalThis.Number(object.vb1Qty) - : isSet(object.vb1_qty) - ? globalThis.Number(object.vb1_qty) - : undefined, - vb2Qty: isSet(object.vb2Qty) - ? globalThis.Number(object.vb2Qty) - : isSet(object.vb2_qty) - ? globalThis.Number(object.vb2_qty) - : undefined, - vb3Qty: isSet(object.vb3Qty) - ? globalThis.Number(object.vb3Qty) - : isSet(object.vb3_qty) - ? globalThis.Number(object.vb3_qty) - : undefined, - vb4Qty: isSet(object.vb4Qty) - ? globalThis.Number(object.vb4Qty) - : isSet(object.vb4_qty) - ? globalThis.Number(object.vb4_qty) + message.paramEfficiency = reader.string(); + continue; + } + case 31: { + if (tag !== 250) { + break; + } + + message.paramDevExpense = reader.string(); + continue; + } + case 32: { + if (tag !== 258) { + break; + } + + message.paramPacking = reader.string(); + continue; + } + case 33: { + if (tag !== 266) { + break; + } + + message.paramMbProdPerDay = reader.string(); + continue; + } + case 34: { + if (tag !== 274) { + break; + } + + message.paramThroughputPerHour = reader.string(); + continue; + } + case 35: { + if (tag !== 282) { + break; + } + + message.paramNoOfProcess = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MBHead { + return { + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + mbhOracleSysId: isSet(object.mbhOracleSysId) + ? globalThis.String(object.mbhOracleSysId) + : isSet(object.mbh_oracle_sys_id) + ? globalThis.String(object.mbh_oracle_sys_id) + : "", + mbhMbCosting: isSet(object.mbhMbCosting) + ? globalThis.String(object.mbhMbCosting) + : isSet(object.mbh_mb_costing) + ? globalThis.String(object.mbh_mb_costing) + : "", + mbhMgtName: isSet(object.mbhMgtName) + ? globalThis.String(object.mbhMgtName) + : isSet(object.mbh_mgt_name) + ? globalThis.String(object.mbh_mgt_name) + : "", + mbhDenier: isSet(object.mbhDenier) + ? globalThis.Number(object.mbhDenier) + : isSet(object.mbh_denier) + ? globalThis.Number(object.mbh_denier) : undefined, - vb5Qty: isSet(object.vb5Qty) - ? globalThis.Number(object.vb5Qty) - : isSet(object.vb5_qty) - ? globalThis.Number(object.vb5_qty) + mbhFilament: isSet(object.mbhFilament) + ? globalThis.Number(object.mbhFilament) + : isSet(object.mbh_filament) + ? globalThis.Number(object.mbh_filament) : undefined, - mcPoyBobbinWeight: isSet(object.mcPoyBobbinWeight) - ? globalThis.Number(object.mcPoyBobbinWeight) - : isSet(object.mc_poy_bobbin_weight) - ? globalThis.Number(object.mc_poy_bobbin_weight) + mbhDozing: isSet(object.mbhDozing) + ? globalThis.Number(object.mbhDozing) + : isSet(object.mbh_dozing) + ? globalThis.Number(object.mbh_dozing) : undefined, - mcTotFxdCst: isSet(object.mcTotFxdCst) - ? globalThis.Number(object.mcTotFxdCst) - : isSet(object.mc_tot_fxd_cst) - ? globalThis.Number(object.mc_tot_fxd_cst) + mbhIsActive: isSet(object.mbhIsActive) + ? globalThis.Boolean(object.mbhIsActive) + : isSet(object.mbh_is_active) + ? globalThis.Boolean(object.mbh_is_active) + : false, + mbhCheckStatus: isSet(object.mbhCheckStatus) + ? globalThis.String(object.mbhCheckStatus) + : isSet(object.mbh_check_status) + ? globalThis.String(object.mbh_check_status) : undefined, - mcBobbinPerTrolly: isSet(object.mcBobbinPerTrolly) - ? globalThis.Number(object.mcBobbinPerTrolly) - : isSet(object.mc_bobbin_per_trolly) - ? globalThis.Number(object.mc_bobbin_per_trolly) + mbhStatus: isSet(object.mbhStatus) + ? globalThis.String(object.mbhStatus) + : isSet(object.mbh_status) + ? globalThis.String(object.mbh_status) : undefined, - mcBoxCost: isSet(object.mcBoxCost) - ? globalThis.Number(object.mcBoxCost) - : isSet(object.mc_box_cost) - ? globalThis.Number(object.mc_box_cost) + mbhLdrPrsn: isSet(object.mbhLdrPrsn) + ? globalThis.Number(object.mbhLdrPrsn) + : isSet(object.mbh_ldr_prsn) + ? globalThis.Number(object.mbh_ldr_prsn) : undefined, - mcCaptivePerBobbin: isSet(object.mcCaptivePerBobbin) - ? globalThis.Number(object.mcCaptivePerBobbin) - : isSet(object.mc_captive_per_bobbin) - ? globalThis.Number(object.mc_captive_per_bobbin) + mbhFinalProduct: isSet(object.mbhFinalProduct) + ? globalThis.String(object.mbhFinalProduct) + : isSet(object.mbh_final_product) + ? globalThis.String(object.mbh_final_product) : undefined, - mcWeightage: isSet(object.mcWeightage) - ? globalThis.Number(object.mcWeightage) - : isSet(object.mc_weightage) - ? globalThis.Number(object.mc_weightage) + mbhCode: isSet(object.mbhCode) + ? globalThis.String(object.mbhCode) + : isSet(object.mbh_code) + ? globalThis.String(object.mbh_code) : undefined, + entryStatus: isSet(object.entryStatus) + ? globalThis.String(object.entryStatus) + : isSet(object.entry_status) + ? globalThis.String(object.entry_status) + : "", + isBoughtout: isSet(object.isBoughtout) + ? globalThis.Boolean(object.isBoughtout) + : isSet(object.is_boughtout) + ? globalThis.Boolean(object.is_boughtout) + : false, + audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, + currentVersion: isSet(object.currentVersion) + ? globalThis.Number(object.currentVersion) + : isSet(object.current_version) + ? globalThis.Number(object.current_version) + : 0, + machineFixedTotal: isSet(object.machineFixedTotal) + ? globalThis.String(object.machineFixedTotal) + : isSet(object.machine_fixed_total) + ? globalThis.String(object.machine_fixed_total) + : "", + stateReason: isSet(object.stateReason) + ? globalThis.String(object.stateReason) + : isSet(object.state_reason) + ? globalThis.String(object.state_reason) + : "", + devCode: isSet(object.devCode) + ? globalThis.String(object.devCode) + : isSet(object.dev_code) + ? globalThis.String(object.dev_code) + : "", + shadeCode: isSet(object.shadeCode) + ? globalThis.String(object.shadeCode) + : isSet(object.shade_code) + ? globalThis.String(object.shade_code) + : "", + shadeName: isSet(object.shadeName) + ? globalThis.String(object.shadeName) + : isSet(object.shade_name) + ? globalThis.String(object.shade_name) + : "", + crossSection: isSet(object.crossSection) + ? globalThis.String(object.crossSection) + : isSet(object.cross_section) + ? globalThis.String(object.cross_section) + : "", + lustureCode: isSet(object.lustureCode) + ? globalThis.String(object.lustureCode) + : isSet(object.lusture_code) + ? globalThis.String(object.lusture_code) + : "", + costProductId: isSet(object.costProductId) + ? globalThis.Number(object.costProductId) + : isSet(object.cost_product_id) + ? globalThis.Number(object.cost_product_id) + : 0, + costGeneratedAt: isSet(object.costGeneratedAt) + ? globalThis.String(object.costGeneratedAt) + : isSet(object.cost_generated_at) + ? globalThis.String(object.cost_generated_at) + : "", + costGeneratedBy: isSet(object.costGeneratedBy) + ? globalThis.String(object.costGeneratedBy) + : isSet(object.cost_generated_by) + ? globalThis.String(object.cost_generated_by) + : "", + paramWaste: isSet(object.paramWaste) + ? globalThis.String(object.paramWaste) + : isSet(object.param_waste) + ? globalThis.String(object.param_waste) + : "", + paramQualityLoss: isSet(object.paramQualityLoss) + ? globalThis.String(object.paramQualityLoss) + : isSet(object.param_quality_loss) + ? globalThis.String(object.param_quality_loss) + : "", + paramEfficiency: isSet(object.paramEfficiency) + ? globalThis.String(object.paramEfficiency) + : isSet(object.param_efficiency) + ? globalThis.String(object.param_efficiency) + : "", + paramDevExpense: isSet(object.paramDevExpense) + ? globalThis.String(object.paramDevExpense) + : isSet(object.param_dev_expense) + ? globalThis.String(object.param_dev_expense) + : "", + paramPacking: isSet(object.paramPacking) + ? globalThis.String(object.paramPacking) + : isSet(object.param_packing) + ? globalThis.String(object.param_packing) + : "", + paramMbProdPerDay: isSet(object.paramMbProdPerDay) + ? globalThis.String(object.paramMbProdPerDay) + : isSet(object.param_mb_prod_per_day) + ? globalThis.String(object.param_mb_prod_per_day) + : "", + paramThroughputPerHour: isSet(object.paramThroughputPerHour) + ? globalThis.String(object.paramThroughputPerHour) + : isSet(object.param_throughput_per_hour) + ? globalThis.String(object.param_throughput_per_hour) + : "", + paramNoOfProcess: isSet(object.paramNoOfProcess) + ? globalThis.String(object.paramNoOfProcess) + : isSet(object.param_no_of_process) + ? globalThis.String(object.param_no_of_process) + : "", }; }, - toJSON(message: Machine): unknown { + toJSON(message: MBHead): unknown { const obj: any = {}; - if (message.machineId !== "") { - obj.machineId = message.machineId; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } - if (message.machineCode !== "") { - obj.machineCode = message.machineCode; + if (message.mbhOracleSysId !== "") { + obj.mbhOracleSysId = message.mbhOracleSysId; } - if (message.machineName !== "") { - obj.machineName = message.machineName; + if (message.mbhMbCosting !== "") { + obj.mbhMbCosting = message.mbhMbCosting; } - if (message.mcType !== "") { - obj.mcType = message.mcType; + if (message.mbhMgtName !== "") { + obj.mbhMgtName = message.mbhMgtName; } - if (message.mcLocation !== "") { - obj.mcLocation = message.mcLocation; + if (message.mbhDenier !== undefined) { + obj.mbhDenier = message.mbhDenier; } - if (message.noOfPosition !== 0) { - obj.noOfPosition = Math.round(message.noOfPosition); + if (message.mbhFilament !== undefined) { + obj.mbhFilament = Math.round(message.mbhFilament); } - if (message.noOfEnd !== 0) { - obj.noOfEnd = Math.round(message.noOfEnd); + if (message.mbhDozing !== undefined) { + obj.mbhDozing = message.mbhDozing; } - if (message.mcSpeed !== 0) { - obj.mcSpeed = message.mcSpeed; + if (message.mbhIsActive !== false) { + obj.mbhIsActive = message.mbhIsActive; } - if (message.machineRpm !== undefined) { - obj.machineRpm = message.machineRpm; + if (message.mbhCheckStatus !== undefined) { + obj.mbhCheckStatus = message.mbhCheckStatus; } - if (message.mcEfficiency !== 0) { - obj.mcEfficiency = message.mcEfficiency; + if (message.mbhStatus !== undefined) { + obj.mbhStatus = message.mbhStatus; } - if (message.powerPerDay !== undefined) { - obj.powerPerDay = message.powerPerDay; + if (message.mbhLdrPrsn !== undefined) { + obj.mbhLdrPrsn = message.mbhLdrPrsn; } - if (message.isActive !== false) { - obj.isActive = message.isActive; + if (message.mbhFinalProduct !== undefined) { + obj.mbhFinalProduct = message.mbhFinalProduct; } - if (message.notes !== "") { - obj.notes = message.notes; + if (message.mbhCode !== undefined) { + obj.mbhCode = message.mbhCode; } - if (message.mpPerDay !== undefined) { - obj.mpPerDay = message.mpPerDay; + if (message.entryStatus !== "") { + obj.entryStatus = message.entryStatus; } - if (message.ohsPerDay !== undefined) { - obj.ohsPerDay = message.ohsPerDay; + if (message.isBoughtout !== false) { + obj.isBoughtout = message.isBoughtout; } if (message.audit !== undefined) { obj.audit = AuditInfo.toJSON(message.audit); } - if (message.sparesPerDay !== undefined) { - obj.sparesPerDay = message.sparesPerDay; + if (message.currentVersion !== 0) { + obj.currentVersion = Math.round(message.currentVersion); } - if (message.kgsLostChange !== undefined) { - obj.kgsLostChange = message.kgsLostChange; + if (message.machineFixedTotal !== "") { + obj.machineFixedTotal = message.machineFixedTotal; } - if (message.vb1Qty !== undefined) { - obj.vb1Qty = message.vb1Qty; + if (message.stateReason !== "") { + obj.stateReason = message.stateReason; } - if (message.vb2Qty !== undefined) { - obj.vb2Qty = message.vb2Qty; + if (message.devCode !== "") { + obj.devCode = message.devCode; } - if (message.vb3Qty !== undefined) { - obj.vb3Qty = message.vb3Qty; + if (message.shadeCode !== "") { + obj.shadeCode = message.shadeCode; } - if (message.vb4Qty !== undefined) { - obj.vb4Qty = message.vb4Qty; + if (message.shadeName !== "") { + obj.shadeName = message.shadeName; } - if (message.vb5Qty !== undefined) { - obj.vb5Qty = message.vb5Qty; + if (message.crossSection !== "") { + obj.crossSection = message.crossSection; } - if (message.mcPoyBobbinWeight !== undefined) { - obj.mcPoyBobbinWeight = message.mcPoyBobbinWeight; + if (message.lustureCode !== "") { + obj.lustureCode = message.lustureCode; } - if (message.mcTotFxdCst !== undefined) { - obj.mcTotFxdCst = message.mcTotFxdCst; + if (message.costProductId !== 0) { + obj.costProductId = Math.round(message.costProductId); } - if (message.mcBobbinPerTrolly !== undefined) { - obj.mcBobbinPerTrolly = message.mcBobbinPerTrolly; + if (message.costGeneratedAt !== "") { + obj.costGeneratedAt = message.costGeneratedAt; } - if (message.mcBoxCost !== undefined) { - obj.mcBoxCost = message.mcBoxCost; + if (message.costGeneratedBy !== "") { + obj.costGeneratedBy = message.costGeneratedBy; } - if (message.mcCaptivePerBobbin !== undefined) { - obj.mcCaptivePerBobbin = message.mcCaptivePerBobbin; + if (message.paramWaste !== "") { + obj.paramWaste = message.paramWaste; } - if (message.mcWeightage !== undefined) { - obj.mcWeightage = message.mcWeightage; + if (message.paramQualityLoss !== "") { + obj.paramQualityLoss = message.paramQualityLoss; + } + if (message.paramEfficiency !== "") { + obj.paramEfficiency = message.paramEfficiency; + } + if (message.paramDevExpense !== "") { + obj.paramDevExpense = message.paramDevExpense; + } + if (message.paramPacking !== "") { + obj.paramPacking = message.paramPacking; + } + if (message.paramMbProdPerDay !== "") { + obj.paramMbProdPerDay = message.paramMbProdPerDay; + } + if (message.paramThroughputPerHour !== "") { + obj.paramThroughputPerHour = message.paramThroughputPerHour; + } + if (message.paramNoOfProcess !== "") { + obj.paramNoOfProcess = message.paramNoOfProcess; } return obj; }, - create(base?: DeepPartial): Machine { - return Machine.fromPartial(base ?? {}); + create(base?: DeepPartial): MBHead { + return MBHead.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): Machine { - const message = createBaseMachine(); - message.machineId = object.machineId ?? ""; - message.machineCode = object.machineCode ?? ""; - message.machineName = object.machineName ?? ""; - message.mcType = object.mcType ?? ""; - message.mcLocation = object.mcLocation ?? ""; - message.noOfPosition = object.noOfPosition ?? 0; - message.noOfEnd = object.noOfEnd ?? 0; - message.mcSpeed = object.mcSpeed ?? 0; - message.machineRpm = object.machineRpm ?? undefined; - message.mcEfficiency = object.mcEfficiency ?? 0; - message.powerPerDay = object.powerPerDay ?? undefined; - message.isActive = object.isActive ?? false; - message.notes = object.notes ?? ""; - message.mpPerDay = object.mpPerDay ?? undefined; - message.ohsPerDay = object.ohsPerDay ?? undefined; + fromPartial(object: DeepPartial): MBHead { + const message = createBaseMBHead(); + message.mbhId = object.mbhId ?? ""; + message.mbhOracleSysId = object.mbhOracleSysId ?? ""; + message.mbhMbCosting = object.mbhMbCosting ?? ""; + message.mbhMgtName = object.mbhMgtName ?? ""; + message.mbhDenier = object.mbhDenier ?? undefined; + message.mbhFilament = object.mbhFilament ?? undefined; + message.mbhDozing = object.mbhDozing ?? undefined; + message.mbhIsActive = object.mbhIsActive ?? false; + message.mbhCheckStatus = object.mbhCheckStatus ?? undefined; + message.mbhStatus = object.mbhStatus ?? undefined; + message.mbhLdrPrsn = object.mbhLdrPrsn ?? undefined; + message.mbhFinalProduct = object.mbhFinalProduct ?? undefined; + message.mbhCode = object.mbhCode ?? undefined; + message.entryStatus = object.entryStatus ?? ""; + message.isBoughtout = object.isBoughtout ?? false; message.audit = (object.audit !== undefined && object.audit !== null) ? AuditInfo.fromPartial(object.audit) : undefined; - message.sparesPerDay = object.sparesPerDay ?? undefined; - message.kgsLostChange = object.kgsLostChange ?? undefined; - message.vb1Qty = object.vb1Qty ?? undefined; - message.vb2Qty = object.vb2Qty ?? undefined; - message.vb3Qty = object.vb3Qty ?? undefined; - message.vb4Qty = object.vb4Qty ?? undefined; - message.vb5Qty = object.vb5Qty ?? undefined; - message.mcPoyBobbinWeight = object.mcPoyBobbinWeight ?? undefined; - message.mcTotFxdCst = object.mcTotFxdCst ?? undefined; - message.mcBobbinPerTrolly = object.mcBobbinPerTrolly ?? undefined; - message.mcBoxCost = object.mcBoxCost ?? undefined; - message.mcCaptivePerBobbin = object.mcCaptivePerBobbin ?? undefined; - message.mcWeightage = object.mcWeightage ?? undefined; + message.currentVersion = object.currentVersion ?? 0; + message.machineFixedTotal = object.machineFixedTotal ?? ""; + message.stateReason = object.stateReason ?? ""; + message.devCode = object.devCode ?? ""; + message.shadeCode = object.shadeCode ?? ""; + message.shadeName = object.shadeName ?? ""; + message.crossSection = object.crossSection ?? ""; + message.lustureCode = object.lustureCode ?? ""; + message.costProductId = object.costProductId ?? 0; + message.costGeneratedAt = object.costGeneratedAt ?? ""; + message.costGeneratedBy = object.costGeneratedBy ?? ""; + message.paramWaste = object.paramWaste ?? ""; + message.paramQualityLoss = object.paramQualityLoss ?? ""; + message.paramEfficiency = object.paramEfficiency ?? ""; + message.paramDevExpense = object.paramDevExpense ?? ""; + message.paramPacking = object.paramPacking ?? ""; + message.paramMbProdPerDay = object.paramMbProdPerDay ?? ""; + message.paramThroughputPerHour = object.paramThroughputPerHour ?? ""; + message.paramNoOfProcess = object.paramNoOfProcess ?? ""; return message; }, }; -function createBaseCreateMachineRequest(): CreateMachineRequest { +function createBaseCreateMBHeadRequest(): CreateMBHeadRequest { return { - machineCode: "", - machineName: "", - mcType: "", - mcLocation: "", - noOfPosition: 0, - noOfEnd: 0, - mcSpeed: 0, - machineRpm: undefined, - mcEfficiency: 0, - powerPerDay: undefined, - notes: "", - mpPerDay: undefined, - ohsPerDay: undefined, - sparesPerDay: undefined, - kgsLostChange: undefined, - vb1Qty: undefined, - vb2Qty: undefined, - vb3Qty: undefined, - vb4Qty: undefined, - vb5Qty: undefined, - mcPoyBobbinWeight: undefined, - mcTotFxdCst: undefined, - mcBobbinPerTrolly: undefined, - mcBoxCost: undefined, - mcCaptivePerBobbin: undefined, - mcWeightage: undefined, + mbhMbCosting: "", + mbhOracleSysId: undefined, + mbhMgtName: undefined, + mbhDenier: undefined, + mbhFilament: undefined, + mbhDozing: undefined, + mbhCheckStatus: undefined, + mbhStatus: undefined, + mbhLdrPrsn: undefined, + mbhFinalProduct: undefined, + mbhCode: undefined, + mbhIsBoughtout: false, + mbhDevCode: undefined, + mbhShadeCode: undefined, + mbhShadeName: undefined, + mbhCrossSection: undefined, + mbhLustureCode: undefined, }; } -export const CreateMachineRequest: MessageFns = { - encode(message: CreateMachineRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.machineCode !== "") { - writer.uint32(10).string(message.machineCode); - } - if (message.machineName !== "") { - writer.uint32(18).string(message.machineName); - } - if (message.mcType !== "") { - writer.uint32(26).string(message.mcType); - } - if (message.mcLocation !== "") { - writer.uint32(34).string(message.mcLocation); - } - if (message.noOfPosition !== 0) { - writer.uint32(40).int32(message.noOfPosition); - } - if (message.noOfEnd !== 0) { - writer.uint32(48).int32(message.noOfEnd); - } - if (message.mcSpeed !== 0) { - writer.uint32(57).double(message.mcSpeed); - } - if (message.machineRpm !== undefined) { - writer.uint32(65).double(message.machineRpm); - } - if (message.mcEfficiency !== 0) { - writer.uint32(73).double(message.mcEfficiency); - } - if (message.powerPerDay !== undefined) { - writer.uint32(81).double(message.powerPerDay); +export const CreateMBHeadRequest: MessageFns = { + encode(message: CreateMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhMbCosting !== "") { + writer.uint32(10).string(message.mbhMbCosting); } - if (message.notes !== "") { - writer.uint32(90).string(message.notes); + if (message.mbhOracleSysId !== undefined) { + writer.uint32(18).string(message.mbhOracleSysId); } - if (message.mpPerDay !== undefined) { - writer.uint32(97).double(message.mpPerDay); + if (message.mbhMgtName !== undefined) { + writer.uint32(26).string(message.mbhMgtName); } - if (message.ohsPerDay !== undefined) { - writer.uint32(105).double(message.ohsPerDay); + if (message.mbhDenier !== undefined) { + writer.uint32(33).double(message.mbhDenier); } - if (message.sparesPerDay !== undefined) { - writer.uint32(113).double(message.sparesPerDay); + if (message.mbhFilament !== undefined) { + writer.uint32(40).int32(message.mbhFilament); } - if (message.kgsLostChange !== undefined) { - writer.uint32(121).double(message.kgsLostChange); + if (message.mbhDozing !== undefined) { + writer.uint32(49).double(message.mbhDozing); } - if (message.vb1Qty !== undefined) { - writer.uint32(129).double(message.vb1Qty); + if (message.mbhCheckStatus !== undefined) { + writer.uint32(58).string(message.mbhCheckStatus); } - if (message.vb2Qty !== undefined) { - writer.uint32(137).double(message.vb2Qty); + if (message.mbhStatus !== undefined) { + writer.uint32(66).string(message.mbhStatus); } - if (message.vb3Qty !== undefined) { - writer.uint32(145).double(message.vb3Qty); + if (message.mbhLdrPrsn !== undefined) { + writer.uint32(73).double(message.mbhLdrPrsn); } - if (message.vb4Qty !== undefined) { - writer.uint32(153).double(message.vb4Qty); + if (message.mbhFinalProduct !== undefined) { + writer.uint32(82).string(message.mbhFinalProduct); } - if (message.vb5Qty !== undefined) { - writer.uint32(161).double(message.vb5Qty); + if (message.mbhCode !== undefined) { + writer.uint32(90).string(message.mbhCode); } - if (message.mcPoyBobbinWeight !== undefined) { - writer.uint32(169).double(message.mcPoyBobbinWeight); + if (message.mbhIsBoughtout !== false) { + writer.uint32(96).bool(message.mbhIsBoughtout); } - if (message.mcTotFxdCst !== undefined) { - writer.uint32(177).double(message.mcTotFxdCst); + if (message.mbhDevCode !== undefined) { + writer.uint32(106).string(message.mbhDevCode); } - if (message.mcBobbinPerTrolly !== undefined) { - writer.uint32(185).double(message.mcBobbinPerTrolly); + if (message.mbhShadeCode !== undefined) { + writer.uint32(114).string(message.mbhShadeCode); } - if (message.mcBoxCost !== undefined) { - writer.uint32(193).double(message.mcBoxCost); + if (message.mbhShadeName !== undefined) { + writer.uint32(122).string(message.mbhShadeName); } - if (message.mcCaptivePerBobbin !== undefined) { - writer.uint32(201).double(message.mcCaptivePerBobbin); + if (message.mbhCrossSection !== undefined) { + writer.uint32(130).string(message.mbhCrossSection); } - if (message.mcWeightage !== undefined) { - writer.uint32(209).double(message.mcWeightage); + if (message.mbhLustureCode !== undefined) { + writer.uint32(138).string(message.mbhLustureCode); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateMachineRequest { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMBHeadRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateMachineRequest(); + const message = createBaseCreateMBHeadRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -2885,7 +13884,7 @@ export const CreateMachineRequest: MessageFns = { break; } - message.machineCode = reader.string(); + message.mbhMbCosting = reader.string(); continue; } case 2: { @@ -2893,7 +13892,7 @@ export const CreateMachineRequest: MessageFns = { break; } - message.machineName = reader.string(); + message.mbhOracleSysId = reader.string(); continue; } case 3: { @@ -2901,15 +13900,15 @@ export const CreateMachineRequest: MessageFns = { break; } - message.mcType = reader.string(); + message.mbhMgtName = reader.string(); continue; } case 4: { - if (tag !== 34) { + if (tag !== 33) { break; } - message.mcLocation = reader.string(); + message.mbhDenier = reader.double(); continue; } case 5: { @@ -2917,31 +13916,31 @@ export const CreateMachineRequest: MessageFns = { break; } - message.noOfPosition = reader.int32(); + message.mbhFilament = reader.int32(); continue; } case 6: { - if (tag !== 48) { + if (tag !== 49) { break; } - message.noOfEnd = reader.int32(); + message.mbhDozing = reader.double(); continue; } case 7: { - if (tag !== 57) { + if (tag !== 58) { break; } - message.mcSpeed = reader.double(); + message.mbhCheckStatus = reader.string(); continue; } case 8: { - if (tag !== 65) { + if (tag !== 66) { break; } - message.machineRpm = reader.double(); + message.mbhStatus = reader.string(); continue; } case 9: { @@ -2949,143 +13948,71 @@ export const CreateMachineRequest: MessageFns = { break; } - message.mcEfficiency = reader.double(); + message.mbhLdrPrsn = reader.double(); continue; } case 10: { - if (tag !== 81) { - break; - } - - message.powerPerDay = reader.double(); - continue; - } - case 11: { - if (tag !== 90) { - break; - } - - message.notes = reader.string(); - continue; - } - case 12: { - if (tag !== 97) { - break; - } - - message.mpPerDay = reader.double(); - continue; - } - case 13: { - if (tag !== 105) { - break; - } - - message.ohsPerDay = reader.double(); - continue; - } - case 14: { - if (tag !== 113) { - break; - } - - message.sparesPerDay = reader.double(); - continue; - } - case 15: { - if (tag !== 121) { - break; - } - - message.kgsLostChange = reader.double(); - continue; - } - case 16: { - if (tag !== 129) { - break; - } - - message.vb1Qty = reader.double(); - continue; - } - case 17: { - if (tag !== 137) { - break; - } - - message.vb2Qty = reader.double(); - continue; - } - case 18: { - if (tag !== 145) { - break; - } - - message.vb3Qty = reader.double(); - continue; - } - case 19: { - if (tag !== 153) { + if (tag !== 82) { break; } - message.vb4Qty = reader.double(); + message.mbhFinalProduct = reader.string(); continue; } - case 20: { - if (tag !== 161) { + case 11: { + if (tag !== 90) { break; } - message.vb5Qty = reader.double(); + message.mbhCode = reader.string(); continue; } - case 21: { - if (tag !== 169) { + case 12: { + if (tag !== 96) { break; } - message.mcPoyBobbinWeight = reader.double(); + message.mbhIsBoughtout = reader.bool(); continue; } - case 22: { - if (tag !== 177) { + case 13: { + if (tag !== 106) { break; } - message.mcTotFxdCst = reader.double(); + message.mbhDevCode = reader.string(); continue; } - case 23: { - if (tag !== 185) { + case 14: { + if (tag !== 114) { break; } - message.mcBobbinPerTrolly = reader.double(); + message.mbhShadeCode = reader.string(); continue; } - case 24: { - if (tag !== 193) { + case 15: { + if (tag !== 122) { break; } - message.mcBoxCost = reader.double(); + message.mbhShadeName = reader.string(); continue; } - case 25: { - if (tag !== 201) { + case 16: { + if (tag !== 130) { break; } - message.mcCaptivePerBobbin = reader.double(); + message.mbhCrossSection = reader.string(); continue; } - case 26: { - if (tag !== 209) { + case 17: { + if (tag !== 138) { break; } - message.mcWeightage = reader.double(); + message.mbhLustureCode = reader.string(); continue; } } @@ -3097,274 +14024,197 @@ export const CreateMachineRequest: MessageFns = { return message; }, - fromJSON(object: any): CreateMachineRequest { + fromJSON(object: any): CreateMBHeadRequest { return { - machineCode: isSet(object.machineCode) - ? globalThis.String(object.machineCode) - : isSet(object.machine_code) - ? globalThis.String(object.machine_code) - : "", - machineName: isSet(object.machineName) - ? globalThis.String(object.machineName) - : isSet(object.machine_name) - ? globalThis.String(object.machine_name) - : "", - mcType: isSet(object.mcType) - ? globalThis.String(object.mcType) - : isSet(object.mc_type) - ? globalThis.String(object.mc_type) - : "", - mcLocation: isSet(object.mcLocation) - ? globalThis.String(object.mcLocation) - : isSet(object.mc_location) - ? globalThis.String(object.mc_location) + mbhMbCosting: isSet(object.mbhMbCosting) + ? globalThis.String(object.mbhMbCosting) + : isSet(object.mbh_mb_costing) + ? globalThis.String(object.mbh_mb_costing) : "", - noOfPosition: isSet(object.noOfPosition) - ? globalThis.Number(object.noOfPosition) - : isSet(object.no_of_position) - ? globalThis.Number(object.no_of_position) - : 0, - noOfEnd: isSet(object.noOfEnd) - ? globalThis.Number(object.noOfEnd) - : isSet(object.no_of_end) - ? globalThis.Number(object.no_of_end) - : 0, - mcSpeed: isSet(object.mcSpeed) - ? globalThis.Number(object.mcSpeed) - : isSet(object.mc_speed) - ? globalThis.Number(object.mc_speed) - : 0, - machineRpm: isSet(object.machineRpm) - ? globalThis.Number(object.machineRpm) - : isSet(object.machine_rpm) - ? globalThis.Number(object.machine_rpm) - : undefined, - mcEfficiency: isSet(object.mcEfficiency) - ? globalThis.Number(object.mcEfficiency) - : isSet(object.mc_efficiency) - ? globalThis.Number(object.mc_efficiency) - : 0, - powerPerDay: isSet(object.powerPerDay) - ? globalThis.Number(object.powerPerDay) - : isSet(object.power_per_day) - ? globalThis.Number(object.power_per_day) - : undefined, - notes: isSet(object.notes) ? globalThis.String(object.notes) : "", - mpPerDay: isSet(object.mpPerDay) - ? globalThis.Number(object.mpPerDay) - : isSet(object.mp_per_day) - ? globalThis.Number(object.mp_per_day) + mbhOracleSysId: isSet(object.mbhOracleSysId) + ? globalThis.String(object.mbhOracleSysId) + : isSet(object.mbh_oracle_sys_id) + ? globalThis.String(object.mbh_oracle_sys_id) : undefined, - ohsPerDay: isSet(object.ohsPerDay) - ? globalThis.Number(object.ohsPerDay) - : isSet(object.ohs_per_day) - ? globalThis.Number(object.ohs_per_day) + mbhMgtName: isSet(object.mbhMgtName) + ? globalThis.String(object.mbhMgtName) + : isSet(object.mbh_mgt_name) + ? globalThis.String(object.mbh_mgt_name) : undefined, - sparesPerDay: isSet(object.sparesPerDay) - ? globalThis.Number(object.sparesPerDay) - : isSet(object.spares_per_day) - ? globalThis.Number(object.spares_per_day) + mbhDenier: isSet(object.mbhDenier) + ? globalThis.Number(object.mbhDenier) + : isSet(object.mbh_denier) + ? globalThis.Number(object.mbh_denier) : undefined, - kgsLostChange: isSet(object.kgsLostChange) - ? globalThis.Number(object.kgsLostChange) - : isSet(object.kgs_lost_change) - ? globalThis.Number(object.kgs_lost_change) + mbhFilament: isSet(object.mbhFilament) + ? globalThis.Number(object.mbhFilament) + : isSet(object.mbh_filament) + ? globalThis.Number(object.mbh_filament) : undefined, - vb1Qty: isSet(object.vb1Qty) - ? globalThis.Number(object.vb1Qty) - : isSet(object.vb1_qty) - ? globalThis.Number(object.vb1_qty) + mbhDozing: isSet(object.mbhDozing) + ? globalThis.Number(object.mbhDozing) + : isSet(object.mbh_dozing) + ? globalThis.Number(object.mbh_dozing) : undefined, - vb2Qty: isSet(object.vb2Qty) - ? globalThis.Number(object.vb2Qty) - : isSet(object.vb2_qty) - ? globalThis.Number(object.vb2_qty) + mbhCheckStatus: isSet(object.mbhCheckStatus) + ? globalThis.String(object.mbhCheckStatus) + : isSet(object.mbh_check_status) + ? globalThis.String(object.mbh_check_status) : undefined, - vb3Qty: isSet(object.vb3Qty) - ? globalThis.Number(object.vb3Qty) - : isSet(object.vb3_qty) - ? globalThis.Number(object.vb3_qty) + mbhStatus: isSet(object.mbhStatus) + ? globalThis.String(object.mbhStatus) + : isSet(object.mbh_status) + ? globalThis.String(object.mbh_status) : undefined, - vb4Qty: isSet(object.vb4Qty) - ? globalThis.Number(object.vb4Qty) - : isSet(object.vb4_qty) - ? globalThis.Number(object.vb4_qty) + mbhLdrPrsn: isSet(object.mbhLdrPrsn) + ? globalThis.Number(object.mbhLdrPrsn) + : isSet(object.mbh_ldr_prsn) + ? globalThis.Number(object.mbh_ldr_prsn) : undefined, - vb5Qty: isSet(object.vb5Qty) - ? globalThis.Number(object.vb5Qty) - : isSet(object.vb5_qty) - ? globalThis.Number(object.vb5_qty) + mbhFinalProduct: isSet(object.mbhFinalProduct) + ? globalThis.String(object.mbhFinalProduct) + : isSet(object.mbh_final_product) + ? globalThis.String(object.mbh_final_product) : undefined, - mcPoyBobbinWeight: isSet(object.mcPoyBobbinWeight) - ? globalThis.Number(object.mcPoyBobbinWeight) - : isSet(object.mc_poy_bobbin_weight) - ? globalThis.Number(object.mc_poy_bobbin_weight) + mbhCode: isSet(object.mbhCode) + ? globalThis.String(object.mbhCode) + : isSet(object.mbh_code) + ? globalThis.String(object.mbh_code) : undefined, - mcTotFxdCst: isSet(object.mcTotFxdCst) - ? globalThis.Number(object.mcTotFxdCst) - : isSet(object.mc_tot_fxd_cst) - ? globalThis.Number(object.mc_tot_fxd_cst) + mbhIsBoughtout: isSet(object.mbhIsBoughtout) + ? globalThis.Boolean(object.mbhIsBoughtout) + : isSet(object.mbh_is_boughtout) + ? globalThis.Boolean(object.mbh_is_boughtout) + : false, + mbhDevCode: isSet(object.mbhDevCode) + ? globalThis.String(object.mbhDevCode) + : isSet(object.mbh_dev_code) + ? globalThis.String(object.mbh_dev_code) : undefined, - mcBobbinPerTrolly: isSet(object.mcBobbinPerTrolly) - ? globalThis.Number(object.mcBobbinPerTrolly) - : isSet(object.mc_bobbin_per_trolly) - ? globalThis.Number(object.mc_bobbin_per_trolly) + mbhShadeCode: isSet(object.mbhShadeCode) + ? globalThis.String(object.mbhShadeCode) + : isSet(object.mbh_shade_code) + ? globalThis.String(object.mbh_shade_code) : undefined, - mcBoxCost: isSet(object.mcBoxCost) - ? globalThis.Number(object.mcBoxCost) - : isSet(object.mc_box_cost) - ? globalThis.Number(object.mc_box_cost) + mbhShadeName: isSet(object.mbhShadeName) + ? globalThis.String(object.mbhShadeName) + : isSet(object.mbh_shade_name) + ? globalThis.String(object.mbh_shade_name) : undefined, - mcCaptivePerBobbin: isSet(object.mcCaptivePerBobbin) - ? globalThis.Number(object.mcCaptivePerBobbin) - : isSet(object.mc_captive_per_bobbin) - ? globalThis.Number(object.mc_captive_per_bobbin) + mbhCrossSection: isSet(object.mbhCrossSection) + ? globalThis.String(object.mbhCrossSection) + : isSet(object.mbh_cross_section) + ? globalThis.String(object.mbh_cross_section) : undefined, - mcWeightage: isSet(object.mcWeightage) - ? globalThis.Number(object.mcWeightage) - : isSet(object.mc_weightage) - ? globalThis.Number(object.mc_weightage) + mbhLustureCode: isSet(object.mbhLustureCode) + ? globalThis.String(object.mbhLustureCode) + : isSet(object.mbh_lusture_code) + ? globalThis.String(object.mbh_lusture_code) : undefined, }; }, - toJSON(message: CreateMachineRequest): unknown { + toJSON(message: CreateMBHeadRequest): unknown { const obj: any = {}; - if (message.machineCode !== "") { - obj.machineCode = message.machineCode; - } - if (message.machineName !== "") { - obj.machineName = message.machineName; - } - if (message.mcType !== "") { - obj.mcType = message.mcType; - } - if (message.mcLocation !== "") { - obj.mcLocation = message.mcLocation; - } - if (message.noOfPosition !== 0) { - obj.noOfPosition = Math.round(message.noOfPosition); - } - if (message.noOfEnd !== 0) { - obj.noOfEnd = Math.round(message.noOfEnd); - } - if (message.mcSpeed !== 0) { - obj.mcSpeed = message.mcSpeed; - } - if (message.machineRpm !== undefined) { - obj.machineRpm = message.machineRpm; - } - if (message.mcEfficiency !== 0) { - obj.mcEfficiency = message.mcEfficiency; - } - if (message.powerPerDay !== undefined) { - obj.powerPerDay = message.powerPerDay; + if (message.mbhMbCosting !== "") { + obj.mbhMbCosting = message.mbhMbCosting; } - if (message.notes !== "") { - obj.notes = message.notes; + if (message.mbhOracleSysId !== undefined) { + obj.mbhOracleSysId = message.mbhOracleSysId; } - if (message.mpPerDay !== undefined) { - obj.mpPerDay = message.mpPerDay; + if (message.mbhMgtName !== undefined) { + obj.mbhMgtName = message.mbhMgtName; } - if (message.ohsPerDay !== undefined) { - obj.ohsPerDay = message.ohsPerDay; + if (message.mbhDenier !== undefined) { + obj.mbhDenier = message.mbhDenier; } - if (message.sparesPerDay !== undefined) { - obj.sparesPerDay = message.sparesPerDay; + if (message.mbhFilament !== undefined) { + obj.mbhFilament = Math.round(message.mbhFilament); } - if (message.kgsLostChange !== undefined) { - obj.kgsLostChange = message.kgsLostChange; + if (message.mbhDozing !== undefined) { + obj.mbhDozing = message.mbhDozing; } - if (message.vb1Qty !== undefined) { - obj.vb1Qty = message.vb1Qty; + if (message.mbhCheckStatus !== undefined) { + obj.mbhCheckStatus = message.mbhCheckStatus; } - if (message.vb2Qty !== undefined) { - obj.vb2Qty = message.vb2Qty; + if (message.mbhStatus !== undefined) { + obj.mbhStatus = message.mbhStatus; } - if (message.vb3Qty !== undefined) { - obj.vb3Qty = message.vb3Qty; + if (message.mbhLdrPrsn !== undefined) { + obj.mbhLdrPrsn = message.mbhLdrPrsn; } - if (message.vb4Qty !== undefined) { - obj.vb4Qty = message.vb4Qty; + if (message.mbhFinalProduct !== undefined) { + obj.mbhFinalProduct = message.mbhFinalProduct; } - if (message.vb5Qty !== undefined) { - obj.vb5Qty = message.vb5Qty; + if (message.mbhCode !== undefined) { + obj.mbhCode = message.mbhCode; } - if (message.mcPoyBobbinWeight !== undefined) { - obj.mcPoyBobbinWeight = message.mcPoyBobbinWeight; + if (message.mbhIsBoughtout !== false) { + obj.mbhIsBoughtout = message.mbhIsBoughtout; } - if (message.mcTotFxdCst !== undefined) { - obj.mcTotFxdCst = message.mcTotFxdCst; + if (message.mbhDevCode !== undefined) { + obj.mbhDevCode = message.mbhDevCode; } - if (message.mcBobbinPerTrolly !== undefined) { - obj.mcBobbinPerTrolly = message.mcBobbinPerTrolly; + if (message.mbhShadeCode !== undefined) { + obj.mbhShadeCode = message.mbhShadeCode; } - if (message.mcBoxCost !== undefined) { - obj.mcBoxCost = message.mcBoxCost; + if (message.mbhShadeName !== undefined) { + obj.mbhShadeName = message.mbhShadeName; } - if (message.mcCaptivePerBobbin !== undefined) { - obj.mcCaptivePerBobbin = message.mcCaptivePerBobbin; + if (message.mbhCrossSection !== undefined) { + obj.mbhCrossSection = message.mbhCrossSection; } - if (message.mcWeightage !== undefined) { - obj.mcWeightage = message.mcWeightage; + if (message.mbhLustureCode !== undefined) { + obj.mbhLustureCode = message.mbhLustureCode; } return obj; }, - create(base?: DeepPartial): CreateMachineRequest { - return CreateMachineRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMBHeadRequest { + return CreateMBHeadRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateMachineRequest { - const message = createBaseCreateMachineRequest(); - message.machineCode = object.machineCode ?? ""; - message.machineName = object.machineName ?? ""; - message.mcType = object.mcType ?? ""; - message.mcLocation = object.mcLocation ?? ""; - message.noOfPosition = object.noOfPosition ?? 0; - message.noOfEnd = object.noOfEnd ?? 0; - message.mcSpeed = object.mcSpeed ?? 0; - message.machineRpm = object.machineRpm ?? undefined; - message.mcEfficiency = object.mcEfficiency ?? 0; - message.powerPerDay = object.powerPerDay ?? undefined; - message.notes = object.notes ?? ""; - message.mpPerDay = object.mpPerDay ?? undefined; - message.ohsPerDay = object.ohsPerDay ?? undefined; - message.sparesPerDay = object.sparesPerDay ?? undefined; - message.kgsLostChange = object.kgsLostChange ?? undefined; - message.vb1Qty = object.vb1Qty ?? undefined; - message.vb2Qty = object.vb2Qty ?? undefined; - message.vb3Qty = object.vb3Qty ?? undefined; - message.vb4Qty = object.vb4Qty ?? undefined; - message.vb5Qty = object.vb5Qty ?? undefined; - message.mcPoyBobbinWeight = object.mcPoyBobbinWeight ?? undefined; - message.mcTotFxdCst = object.mcTotFxdCst ?? undefined; - message.mcBobbinPerTrolly = object.mcBobbinPerTrolly ?? undefined; - message.mcBoxCost = object.mcBoxCost ?? undefined; - message.mcCaptivePerBobbin = object.mcCaptivePerBobbin ?? undefined; - message.mcWeightage = object.mcWeightage ?? undefined; + fromPartial(object: DeepPartial): CreateMBHeadRequest { + const message = createBaseCreateMBHeadRequest(); + message.mbhMbCosting = object.mbhMbCosting ?? ""; + message.mbhOracleSysId = object.mbhOracleSysId ?? undefined; + message.mbhMgtName = object.mbhMgtName ?? undefined; + message.mbhDenier = object.mbhDenier ?? undefined; + message.mbhFilament = object.mbhFilament ?? undefined; + message.mbhDozing = object.mbhDozing ?? undefined; + message.mbhCheckStatus = object.mbhCheckStatus ?? undefined; + message.mbhStatus = object.mbhStatus ?? undefined; + message.mbhLdrPrsn = object.mbhLdrPrsn ?? undefined; + message.mbhFinalProduct = object.mbhFinalProduct ?? undefined; + message.mbhCode = object.mbhCode ?? undefined; + message.mbhIsBoughtout = object.mbhIsBoughtout ?? false; + message.mbhDevCode = object.mbhDevCode ?? undefined; + message.mbhShadeCode = object.mbhShadeCode ?? undefined; + message.mbhShadeName = object.mbhShadeName ?? undefined; + message.mbhCrossSection = object.mbhCrossSection ?? undefined; + message.mbhLustureCode = object.mbhLustureCode ?? undefined; return message; }, }; -function createBaseCreateMachineResponse(): CreateMachineResponse { +function createBaseCreateMBHeadResponse(): CreateMBHeadResponse { return { base: undefined, data: undefined }; } -export const CreateMachineResponse: MessageFns = { - encode(message: CreateMachineResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const CreateMBHeadResponse: MessageFns = { + encode(message: CreateMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } if (message.data !== undefined) { - Machine.encode(message.data, writer.uint32(18).fork()).join(); + MBHead.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateMachineResponse { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMBHeadResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateMachineResponse(); + const message = createBaseCreateMBHeadResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3381,7 +14231,7 @@ export const CreateMachineResponse: MessageFns = { break; } - message.data = Machine.decode(reader, reader.uint32()); + message.data = MBHead.decode(reader, reader.uint32()); continue; } } @@ -3393,53 +14243,53 @@ export const CreateMachineResponse: MessageFns = { return message; }, - fromJSON(object: any): CreateMachineResponse { + fromJSON(object: any): CreateMBHeadResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? Machine.fromJSON(object.data) : undefined, + data: isSet(object.data) ? MBHead.fromJSON(object.data) : undefined, }; }, - toJSON(message: CreateMachineResponse): unknown { + toJSON(message: CreateMBHeadResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data !== undefined) { - obj.data = Machine.toJSON(message.data); + obj.data = MBHead.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): CreateMachineResponse { - return CreateMachineResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMBHeadResponse { + return CreateMBHeadResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateMachineResponse { - const message = createBaseCreateMachineResponse(); + fromPartial(object: DeepPartial): CreateMBHeadResponse { + const message = createBaseCreateMBHeadResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) ? Machine.fromPartial(object.data) : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; return message; }, }; -function createBaseGetMachineRequest(): GetMachineRequest { - return { machineId: "" }; +function createBaseGetMBHeadRequest(): GetMBHeadRequest { + return { mbhId: "" }; } -export const GetMachineRequest: MessageFns = { - encode(message: GetMachineRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.machineId !== "") { - writer.uint32(10).string(message.machineId); +export const GetMBHeadRequest: MessageFns = { + encode(message: GetMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetMachineRequest { + decode(input: BinaryReader | Uint8Array, length?: number): GetMBHeadRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetMachineRequest(); + const message = createBaseGetMBHeadRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3448,7 +14298,7 @@ export const GetMachineRequest: MessageFns = { break; } - message.machineId = reader.string(); + message.mbhId = reader.string(); continue; } } @@ -3460,53 +14310,53 @@ export const GetMachineRequest: MessageFns = { return message; }, - fromJSON(object: any): GetMachineRequest { + fromJSON(object: any): GetMBHeadRequest { return { - machineId: isSet(object.machineId) - ? globalThis.String(object.machineId) - : isSet(object.machine_id) - ? globalThis.String(object.machine_id) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) : "", }; }, - toJSON(message: GetMachineRequest): unknown { + toJSON(message: GetMBHeadRequest): unknown { const obj: any = {}; - if (message.machineId !== "") { - obj.machineId = message.machineId; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } return obj; }, - create(base?: DeepPartial): GetMachineRequest { - return GetMachineRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): GetMBHeadRequest { + return GetMBHeadRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetMachineRequest { - const message = createBaseGetMachineRequest(); - message.machineId = object.machineId ?? ""; + fromPartial(object: DeepPartial): GetMBHeadRequest { + const message = createBaseGetMBHeadRequest(); + message.mbhId = object.mbhId ?? ""; return message; }, }; -function createBaseGetMachineResponse(): GetMachineResponse { +function createBaseGetMBHeadResponse(): GetMBHeadResponse { return { base: undefined, data: undefined }; } -export const GetMachineResponse: MessageFns = { - encode(message: GetMachineResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const GetMBHeadResponse: MessageFns = { + encode(message: GetMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } if (message.data !== undefined) { - Machine.encode(message.data, writer.uint32(18).fork()).join(); + MBHead.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetMachineResponse { + decode(input: BinaryReader | Uint8Array, length?: number): GetMBHeadResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetMachineResponse(); + const message = createBaseGetMBHeadResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3523,7 +14373,7 @@ export const GetMachineResponse: MessageFns = { break; } - message.data = Machine.decode(reader, reader.uint32()); + message.data = MBHead.decode(reader, reader.uint32()); continue; } } @@ -3535,159 +14385,119 @@ export const GetMachineResponse: MessageFns = { return message; }, - fromJSON(object: any): GetMachineResponse { + fromJSON(object: any): GetMBHeadResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? Machine.fromJSON(object.data) : undefined, + data: isSet(object.data) ? MBHead.fromJSON(object.data) : undefined, }; }, - toJSON(message: GetMachineResponse): unknown { + toJSON(message: GetMBHeadResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data !== undefined) { - obj.data = Machine.toJSON(message.data); + obj.data = MBHead.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): GetMachineResponse { - return GetMachineResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): GetMBHeadResponse { + return GetMBHeadResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetMachineResponse { - const message = createBaseGetMachineResponse(); + fromPartial(object: DeepPartial): GetMBHeadResponse { + const message = createBaseGetMBHeadResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) ? Machine.fromPartial(object.data) : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; return message; }, }; -function createBaseUpdateMachineRequest(): UpdateMachineRequest { +function createBaseUpdateMBHeadRequest(): UpdateMBHeadRequest { return { - machineId: "", - machineName: undefined, - mcType: undefined, - mcLocation: undefined, - noOfPosition: undefined, - noOfEnd: undefined, - mcSpeed: undefined, - machineRpm: undefined, - mcEfficiency: undefined, - powerPerDay: undefined, - notes: undefined, - isActive: undefined, - mpPerDay: undefined, - ohsPerDay: undefined, - sparesPerDay: undefined, - kgsLostChange: undefined, - vb1Qty: undefined, - vb2Qty: undefined, - vb3Qty: undefined, - vb4Qty: undefined, - vb5Qty: undefined, - mcPoyBobbinWeight: undefined, - mcTotFxdCst: undefined, - mcBobbinPerTrolly: undefined, - mcBoxCost: undefined, - mcCaptivePerBobbin: undefined, - mcWeightage: undefined, + mbhId: "", + mbhMbCosting: undefined, + mbhMgtName: undefined, + mbhDenier: undefined, + mbhFilament: undefined, + mbhDozing: undefined, + mbhIsActive: undefined, + mbhCheckStatus: undefined, + mbhStatus: undefined, + mbhLdrPrsn: undefined, + mbhFinalProduct: undefined, + mbhCode: undefined, + mbhDevCode: undefined, + mbhShadeCode: undefined, + mbhShadeName: undefined, + mbhCrossSection: undefined, + mbhLustureCode: undefined, }; } -export const UpdateMachineRequest: MessageFns = { - encode(message: UpdateMachineRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.machineId !== "") { - writer.uint32(10).string(message.machineId); - } - if (message.machineName !== undefined) { - writer.uint32(18).string(message.machineName); - } - if (message.mcType !== undefined) { - writer.uint32(26).string(message.mcType); - } - if (message.mcLocation !== undefined) { - writer.uint32(34).string(message.mcLocation); - } - if (message.noOfPosition !== undefined) { - writer.uint32(40).int32(message.noOfPosition); - } - if (message.noOfEnd !== undefined) { - writer.uint32(48).int32(message.noOfEnd); - } - if (message.mcSpeed !== undefined) { - writer.uint32(57).double(message.mcSpeed); - } - if (message.machineRpm !== undefined) { - writer.uint32(65).double(message.machineRpm); - } - if (message.mcEfficiency !== undefined) { - writer.uint32(73).double(message.mcEfficiency); - } - if (message.powerPerDay !== undefined) { - writer.uint32(81).double(message.powerPerDay); - } - if (message.notes !== undefined) { - writer.uint32(90).string(message.notes); +export const UpdateMBHeadRequest: MessageFns = { + encode(message: UpdateMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } - if (message.isActive !== undefined) { - writer.uint32(96).bool(message.isActive); + if (message.mbhMbCosting !== undefined) { + writer.uint32(18).string(message.mbhMbCosting); } - if (message.mpPerDay !== undefined) { - writer.uint32(105).double(message.mpPerDay); + if (message.mbhMgtName !== undefined) { + writer.uint32(26).string(message.mbhMgtName); } - if (message.ohsPerDay !== undefined) { - writer.uint32(113).double(message.ohsPerDay); + if (message.mbhDenier !== undefined) { + writer.uint32(33).double(message.mbhDenier); } - if (message.sparesPerDay !== undefined) { - writer.uint32(121).double(message.sparesPerDay); + if (message.mbhFilament !== undefined) { + writer.uint32(40).int32(message.mbhFilament); } - if (message.kgsLostChange !== undefined) { - writer.uint32(129).double(message.kgsLostChange); + if (message.mbhDozing !== undefined) { + writer.uint32(49).double(message.mbhDozing); } - if (message.vb1Qty !== undefined) { - writer.uint32(137).double(message.vb1Qty); + if (message.mbhIsActive !== undefined) { + writer.uint32(56).bool(message.mbhIsActive); } - if (message.vb2Qty !== undefined) { - writer.uint32(145).double(message.vb2Qty); + if (message.mbhCheckStatus !== undefined) { + writer.uint32(66).string(message.mbhCheckStatus); } - if (message.vb3Qty !== undefined) { - writer.uint32(153).double(message.vb3Qty); + if (message.mbhStatus !== undefined) { + writer.uint32(74).string(message.mbhStatus); } - if (message.vb4Qty !== undefined) { - writer.uint32(161).double(message.vb4Qty); + if (message.mbhLdrPrsn !== undefined) { + writer.uint32(81).double(message.mbhLdrPrsn); } - if (message.vb5Qty !== undefined) { - writer.uint32(169).double(message.vb5Qty); + if (message.mbhFinalProduct !== undefined) { + writer.uint32(90).string(message.mbhFinalProduct); } - if (message.mcPoyBobbinWeight !== undefined) { - writer.uint32(177).double(message.mcPoyBobbinWeight); + if (message.mbhCode !== undefined) { + writer.uint32(98).string(message.mbhCode); } - if (message.mcTotFxdCst !== undefined) { - writer.uint32(185).double(message.mcTotFxdCst); + if (message.mbhDevCode !== undefined) { + writer.uint32(106).string(message.mbhDevCode); } - if (message.mcBobbinPerTrolly !== undefined) { - writer.uint32(193).double(message.mcBobbinPerTrolly); + if (message.mbhShadeCode !== undefined) { + writer.uint32(114).string(message.mbhShadeCode); } - if (message.mcBoxCost !== undefined) { - writer.uint32(201).double(message.mcBoxCost); + if (message.mbhShadeName !== undefined) { + writer.uint32(122).string(message.mbhShadeName); } - if (message.mcCaptivePerBobbin !== undefined) { - writer.uint32(209).double(message.mcCaptivePerBobbin); + if (message.mbhCrossSection !== undefined) { + writer.uint32(130).string(message.mbhCrossSection); } - if (message.mcWeightage !== undefined) { - writer.uint32(217).double(message.mcWeightage); + if (message.mbhLustureCode !== undefined) { + writer.uint32(138).string(message.mbhLustureCode); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateMachineRequest { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMBHeadRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateMachineRequest(); + const message = createBaseUpdateMBHeadRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -3696,7 +14506,7 @@ export const UpdateMachineRequest: MessageFns = { break; } - message.machineId = reader.string(); + message.mbhId = reader.string(); continue; } case 2: { @@ -3704,7 +14514,7 @@ export const UpdateMachineRequest: MessageFns = { break; } - message.machineName = reader.string(); + message.mbhMbCosting = reader.string(); continue; } case 3: { @@ -3712,15 +14522,15 @@ export const UpdateMachineRequest: MessageFns = { break; } - message.mcType = reader.string(); + message.mbhMgtName = reader.string(); continue; } case 4: { - if (tag !== 34) { + if (tag !== 33) { break; } - message.mcLocation = reader.string(); + message.mbhDenier = reader.double(); continue; } case 5: { @@ -3728,39 +14538,39 @@ export const UpdateMachineRequest: MessageFns = { break; } - message.noOfPosition = reader.int32(); + message.mbhFilament = reader.int32(); continue; } case 6: { - if (tag !== 48) { + if (tag !== 49) { break; } - message.noOfEnd = reader.int32(); + message.mbhDozing = reader.double(); continue; } case 7: { - if (tag !== 57) { + if (tag !== 56) { break; } - message.mcSpeed = reader.double(); + message.mbhIsActive = reader.bool(); continue; } case 8: { - if (tag !== 65) { + if (tag !== 66) { break; } - message.machineRpm = reader.double(); + message.mbhCheckStatus = reader.string(); continue; } case 9: { - if (tag !== 73) { + if (tag !== 74) { break; } - message.mcEfficiency = reader.double(); + message.mbhStatus = reader.string(); continue; } case 10: { @@ -3768,7 +14578,7 @@ export const UpdateMachineRequest: MessageFns = { break; } - message.powerPerDay = reader.double(); + message.mbhLdrPrsn = reader.double(); continue; } case 11: { @@ -3776,423 +14586,257 @@ export const UpdateMachineRequest: MessageFns = { break; } - message.notes = reader.string(); + message.mbhFinalProduct = reader.string(); continue; } case 12: { - if (tag !== 96) { + if (tag !== 98) { break; } - message.isActive = reader.bool(); + message.mbhCode = reader.string(); continue; } case 13: { - if (tag !== 105) { + if (tag !== 106) { break; } - message.mpPerDay = reader.double(); + message.mbhDevCode = reader.string(); continue; } case 14: { - if (tag !== 113) { + if (tag !== 114) { break; } - message.ohsPerDay = reader.double(); + message.mbhShadeCode = reader.string(); continue; } case 15: { - if (tag !== 121) { + if (tag !== 122) { break; } - message.sparesPerDay = reader.double(); + message.mbhShadeName = reader.string(); continue; } case 16: { - if (tag !== 129) { - break; - } - - message.kgsLostChange = reader.double(); - continue; - } - case 17: { - if (tag !== 137) { - break; - } - - message.vb1Qty = reader.double(); - continue; - } - case 18: { - if (tag !== 145) { - break; - } - - message.vb2Qty = reader.double(); - continue; - } - case 19: { - if (tag !== 153) { - break; - } - - message.vb3Qty = reader.double(); - continue; - } - case 20: { - if (tag !== 161) { - break; - } - - message.vb4Qty = reader.double(); - continue; - } - case 21: { - if (tag !== 169) { - break; - } - - message.vb5Qty = reader.double(); - continue; - } - case 22: { - if (tag !== 177) { - break; - } - - message.mcPoyBobbinWeight = reader.double(); - continue; - } - case 23: { - if (tag !== 185) { - break; - } - - message.mcTotFxdCst = reader.double(); - continue; - } - case 24: { - if (tag !== 193) { - break; - } - - message.mcBobbinPerTrolly = reader.double(); - continue; - } - case 25: { - if (tag !== 201) { - break; - } - - message.mcBoxCost = reader.double(); - continue; - } - case 26: { - if (tag !== 209) { - break; - } - - message.mcCaptivePerBobbin = reader.double(); - continue; - } - case 27: { - if (tag !== 217) { + if (tag !== 130) { break; } - message.mcWeightage = reader.double(); + message.mbhCrossSection = reader.string(); continue; } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): UpdateMachineRequest { - return { - machineId: isSet(object.machineId) - ? globalThis.String(object.machineId) - : isSet(object.machine_id) - ? globalThis.String(object.machine_id) - : "", - machineName: isSet(object.machineName) - ? globalThis.String(object.machineName) - : isSet(object.machine_name) - ? globalThis.String(object.machine_name) - : undefined, - mcType: isSet(object.mcType) - ? globalThis.String(object.mcType) - : isSet(object.mc_type) - ? globalThis.String(object.mc_type) - : undefined, - mcLocation: isSet(object.mcLocation) - ? globalThis.String(object.mcLocation) - : isSet(object.mc_location) - ? globalThis.String(object.mc_location) - : undefined, - noOfPosition: isSet(object.noOfPosition) - ? globalThis.Number(object.noOfPosition) - : isSet(object.no_of_position) - ? globalThis.Number(object.no_of_position) - : undefined, - noOfEnd: isSet(object.noOfEnd) - ? globalThis.Number(object.noOfEnd) - : isSet(object.no_of_end) - ? globalThis.Number(object.no_of_end) - : undefined, - mcSpeed: isSet(object.mcSpeed) - ? globalThis.Number(object.mcSpeed) - : isSet(object.mc_speed) - ? globalThis.Number(object.mc_speed) - : undefined, - machineRpm: isSet(object.machineRpm) - ? globalThis.Number(object.machineRpm) - : isSet(object.machine_rpm) - ? globalThis.Number(object.machine_rpm) - : undefined, - mcEfficiency: isSet(object.mcEfficiency) - ? globalThis.Number(object.mcEfficiency) - : isSet(object.mc_efficiency) - ? globalThis.Number(object.mc_efficiency) - : undefined, - powerPerDay: isSet(object.powerPerDay) - ? globalThis.Number(object.powerPerDay) - : isSet(object.power_per_day) - ? globalThis.Number(object.power_per_day) - : undefined, - notes: isSet(object.notes) ? globalThis.String(object.notes) : undefined, - isActive: isSet(object.isActive) - ? globalThis.Boolean(object.isActive) - : isSet(object.is_active) - ? globalThis.Boolean(object.is_active) + case 17: { + if (tag !== 138) { + break; + } + + message.mbhLustureCode = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UpdateMBHeadRequest { + return { + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + mbhMbCosting: isSet(object.mbhMbCosting) + ? globalThis.String(object.mbhMbCosting) + : isSet(object.mbh_mb_costing) + ? globalThis.String(object.mbh_mb_costing) : undefined, - mpPerDay: isSet(object.mpPerDay) - ? globalThis.Number(object.mpPerDay) - : isSet(object.mp_per_day) - ? globalThis.Number(object.mp_per_day) + mbhMgtName: isSet(object.mbhMgtName) + ? globalThis.String(object.mbhMgtName) + : isSet(object.mbh_mgt_name) + ? globalThis.String(object.mbh_mgt_name) : undefined, - ohsPerDay: isSet(object.ohsPerDay) - ? globalThis.Number(object.ohsPerDay) - : isSet(object.ohs_per_day) - ? globalThis.Number(object.ohs_per_day) + mbhDenier: isSet(object.mbhDenier) + ? globalThis.Number(object.mbhDenier) + : isSet(object.mbh_denier) + ? globalThis.Number(object.mbh_denier) : undefined, - sparesPerDay: isSet(object.sparesPerDay) - ? globalThis.Number(object.sparesPerDay) - : isSet(object.spares_per_day) - ? globalThis.Number(object.spares_per_day) + mbhFilament: isSet(object.mbhFilament) + ? globalThis.Number(object.mbhFilament) + : isSet(object.mbh_filament) + ? globalThis.Number(object.mbh_filament) : undefined, - kgsLostChange: isSet(object.kgsLostChange) - ? globalThis.Number(object.kgsLostChange) - : isSet(object.kgs_lost_change) - ? globalThis.Number(object.kgs_lost_change) + mbhDozing: isSet(object.mbhDozing) + ? globalThis.Number(object.mbhDozing) + : isSet(object.mbh_dozing) + ? globalThis.Number(object.mbh_dozing) : undefined, - vb1Qty: isSet(object.vb1Qty) - ? globalThis.Number(object.vb1Qty) - : isSet(object.vb1_qty) - ? globalThis.Number(object.vb1_qty) + mbhIsActive: isSet(object.mbhIsActive) + ? globalThis.Boolean(object.mbhIsActive) + : isSet(object.mbh_is_active) + ? globalThis.Boolean(object.mbh_is_active) : undefined, - vb2Qty: isSet(object.vb2Qty) - ? globalThis.Number(object.vb2Qty) - : isSet(object.vb2_qty) - ? globalThis.Number(object.vb2_qty) + mbhCheckStatus: isSet(object.mbhCheckStatus) + ? globalThis.String(object.mbhCheckStatus) + : isSet(object.mbh_check_status) + ? globalThis.String(object.mbh_check_status) : undefined, - vb3Qty: isSet(object.vb3Qty) - ? globalThis.Number(object.vb3Qty) - : isSet(object.vb3_qty) - ? globalThis.Number(object.vb3_qty) + mbhStatus: isSet(object.mbhStatus) + ? globalThis.String(object.mbhStatus) + : isSet(object.mbh_status) + ? globalThis.String(object.mbh_status) : undefined, - vb4Qty: isSet(object.vb4Qty) - ? globalThis.Number(object.vb4Qty) - : isSet(object.vb4_qty) - ? globalThis.Number(object.vb4_qty) + mbhLdrPrsn: isSet(object.mbhLdrPrsn) + ? globalThis.Number(object.mbhLdrPrsn) + : isSet(object.mbh_ldr_prsn) + ? globalThis.Number(object.mbh_ldr_prsn) : undefined, - vb5Qty: isSet(object.vb5Qty) - ? globalThis.Number(object.vb5Qty) - : isSet(object.vb5_qty) - ? globalThis.Number(object.vb5_qty) + mbhFinalProduct: isSet(object.mbhFinalProduct) + ? globalThis.String(object.mbhFinalProduct) + : isSet(object.mbh_final_product) + ? globalThis.String(object.mbh_final_product) : undefined, - mcPoyBobbinWeight: isSet(object.mcPoyBobbinWeight) - ? globalThis.Number(object.mcPoyBobbinWeight) - : isSet(object.mc_poy_bobbin_weight) - ? globalThis.Number(object.mc_poy_bobbin_weight) + mbhCode: isSet(object.mbhCode) + ? globalThis.String(object.mbhCode) + : isSet(object.mbh_code) + ? globalThis.String(object.mbh_code) : undefined, - mcTotFxdCst: isSet(object.mcTotFxdCst) - ? globalThis.Number(object.mcTotFxdCst) - : isSet(object.mc_tot_fxd_cst) - ? globalThis.Number(object.mc_tot_fxd_cst) + mbhDevCode: isSet(object.mbhDevCode) + ? globalThis.String(object.mbhDevCode) + : isSet(object.mbh_dev_code) + ? globalThis.String(object.mbh_dev_code) : undefined, - mcBobbinPerTrolly: isSet(object.mcBobbinPerTrolly) - ? globalThis.Number(object.mcBobbinPerTrolly) - : isSet(object.mc_bobbin_per_trolly) - ? globalThis.Number(object.mc_bobbin_per_trolly) + mbhShadeCode: isSet(object.mbhShadeCode) + ? globalThis.String(object.mbhShadeCode) + : isSet(object.mbh_shade_code) + ? globalThis.String(object.mbh_shade_code) : undefined, - mcBoxCost: isSet(object.mcBoxCost) - ? globalThis.Number(object.mcBoxCost) - : isSet(object.mc_box_cost) - ? globalThis.Number(object.mc_box_cost) + mbhShadeName: isSet(object.mbhShadeName) + ? globalThis.String(object.mbhShadeName) + : isSet(object.mbh_shade_name) + ? globalThis.String(object.mbh_shade_name) : undefined, - mcCaptivePerBobbin: isSet(object.mcCaptivePerBobbin) - ? globalThis.Number(object.mcCaptivePerBobbin) - : isSet(object.mc_captive_per_bobbin) - ? globalThis.Number(object.mc_captive_per_bobbin) + mbhCrossSection: isSet(object.mbhCrossSection) + ? globalThis.String(object.mbhCrossSection) + : isSet(object.mbh_cross_section) + ? globalThis.String(object.mbh_cross_section) : undefined, - mcWeightage: isSet(object.mcWeightage) - ? globalThis.Number(object.mcWeightage) - : isSet(object.mc_weightage) - ? globalThis.Number(object.mc_weightage) + mbhLustureCode: isSet(object.mbhLustureCode) + ? globalThis.String(object.mbhLustureCode) + : isSet(object.mbh_lusture_code) + ? globalThis.String(object.mbh_lusture_code) : undefined, }; }, - toJSON(message: UpdateMachineRequest): unknown { + toJSON(message: UpdateMBHeadRequest): unknown { const obj: any = {}; - if (message.machineId !== "") { - obj.machineId = message.machineId; - } - if (message.machineName !== undefined) { - obj.machineName = message.machineName; - } - if (message.mcType !== undefined) { - obj.mcType = message.mcType; - } - if (message.mcLocation !== undefined) { - obj.mcLocation = message.mcLocation; - } - if (message.noOfPosition !== undefined) { - obj.noOfPosition = Math.round(message.noOfPosition); - } - if (message.noOfEnd !== undefined) { - obj.noOfEnd = Math.round(message.noOfEnd); - } - if (message.mcSpeed !== undefined) { - obj.mcSpeed = message.mcSpeed; - } - if (message.machineRpm !== undefined) { - obj.machineRpm = message.machineRpm; - } - if (message.mcEfficiency !== undefined) { - obj.mcEfficiency = message.mcEfficiency; - } - if (message.powerPerDay !== undefined) { - obj.powerPerDay = message.powerPerDay; - } - if (message.notes !== undefined) { - obj.notes = message.notes; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } - if (message.isActive !== undefined) { - obj.isActive = message.isActive; + if (message.mbhMbCosting !== undefined) { + obj.mbhMbCosting = message.mbhMbCosting; } - if (message.mpPerDay !== undefined) { - obj.mpPerDay = message.mpPerDay; + if (message.mbhMgtName !== undefined) { + obj.mbhMgtName = message.mbhMgtName; } - if (message.ohsPerDay !== undefined) { - obj.ohsPerDay = message.ohsPerDay; + if (message.mbhDenier !== undefined) { + obj.mbhDenier = message.mbhDenier; } - if (message.sparesPerDay !== undefined) { - obj.sparesPerDay = message.sparesPerDay; + if (message.mbhFilament !== undefined) { + obj.mbhFilament = Math.round(message.mbhFilament); } - if (message.kgsLostChange !== undefined) { - obj.kgsLostChange = message.kgsLostChange; + if (message.mbhDozing !== undefined) { + obj.mbhDozing = message.mbhDozing; } - if (message.vb1Qty !== undefined) { - obj.vb1Qty = message.vb1Qty; + if (message.mbhIsActive !== undefined) { + obj.mbhIsActive = message.mbhIsActive; } - if (message.vb2Qty !== undefined) { - obj.vb2Qty = message.vb2Qty; + if (message.mbhCheckStatus !== undefined) { + obj.mbhCheckStatus = message.mbhCheckStatus; } - if (message.vb3Qty !== undefined) { - obj.vb3Qty = message.vb3Qty; + if (message.mbhStatus !== undefined) { + obj.mbhStatus = message.mbhStatus; } - if (message.vb4Qty !== undefined) { - obj.vb4Qty = message.vb4Qty; + if (message.mbhLdrPrsn !== undefined) { + obj.mbhLdrPrsn = message.mbhLdrPrsn; } - if (message.vb5Qty !== undefined) { - obj.vb5Qty = message.vb5Qty; + if (message.mbhFinalProduct !== undefined) { + obj.mbhFinalProduct = message.mbhFinalProduct; } - if (message.mcPoyBobbinWeight !== undefined) { - obj.mcPoyBobbinWeight = message.mcPoyBobbinWeight; + if (message.mbhCode !== undefined) { + obj.mbhCode = message.mbhCode; } - if (message.mcTotFxdCst !== undefined) { - obj.mcTotFxdCst = message.mcTotFxdCst; + if (message.mbhDevCode !== undefined) { + obj.mbhDevCode = message.mbhDevCode; } - if (message.mcBobbinPerTrolly !== undefined) { - obj.mcBobbinPerTrolly = message.mcBobbinPerTrolly; + if (message.mbhShadeCode !== undefined) { + obj.mbhShadeCode = message.mbhShadeCode; } - if (message.mcBoxCost !== undefined) { - obj.mcBoxCost = message.mcBoxCost; + if (message.mbhShadeName !== undefined) { + obj.mbhShadeName = message.mbhShadeName; } - if (message.mcCaptivePerBobbin !== undefined) { - obj.mcCaptivePerBobbin = message.mcCaptivePerBobbin; + if (message.mbhCrossSection !== undefined) { + obj.mbhCrossSection = message.mbhCrossSection; } - if (message.mcWeightage !== undefined) { - obj.mcWeightage = message.mcWeightage; + if (message.mbhLustureCode !== undefined) { + obj.mbhLustureCode = message.mbhLustureCode; } return obj; }, - create(base?: DeepPartial): UpdateMachineRequest { - return UpdateMachineRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateMBHeadRequest { + return UpdateMBHeadRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateMachineRequest { - const message = createBaseUpdateMachineRequest(); - message.machineId = object.machineId ?? ""; - message.machineName = object.machineName ?? undefined; - message.mcType = object.mcType ?? undefined; - message.mcLocation = object.mcLocation ?? undefined; - message.noOfPosition = object.noOfPosition ?? undefined; - message.noOfEnd = object.noOfEnd ?? undefined; - message.mcSpeed = object.mcSpeed ?? undefined; - message.machineRpm = object.machineRpm ?? undefined; - message.mcEfficiency = object.mcEfficiency ?? undefined; - message.powerPerDay = object.powerPerDay ?? undefined; - message.notes = object.notes ?? undefined; - message.isActive = object.isActive ?? undefined; - message.mpPerDay = object.mpPerDay ?? undefined; - message.ohsPerDay = object.ohsPerDay ?? undefined; - message.sparesPerDay = object.sparesPerDay ?? undefined; - message.kgsLostChange = object.kgsLostChange ?? undefined; - message.vb1Qty = object.vb1Qty ?? undefined; - message.vb2Qty = object.vb2Qty ?? undefined; - message.vb3Qty = object.vb3Qty ?? undefined; - message.vb4Qty = object.vb4Qty ?? undefined; - message.vb5Qty = object.vb5Qty ?? undefined; - message.mcPoyBobbinWeight = object.mcPoyBobbinWeight ?? undefined; - message.mcTotFxdCst = object.mcTotFxdCst ?? undefined; - message.mcBobbinPerTrolly = object.mcBobbinPerTrolly ?? undefined; - message.mcBoxCost = object.mcBoxCost ?? undefined; - message.mcCaptivePerBobbin = object.mcCaptivePerBobbin ?? undefined; - message.mcWeightage = object.mcWeightage ?? undefined; + fromPartial(object: DeepPartial): UpdateMBHeadRequest { + const message = createBaseUpdateMBHeadRequest(); + message.mbhId = object.mbhId ?? ""; + message.mbhMbCosting = object.mbhMbCosting ?? undefined; + message.mbhMgtName = object.mbhMgtName ?? undefined; + message.mbhDenier = object.mbhDenier ?? undefined; + message.mbhFilament = object.mbhFilament ?? undefined; + message.mbhDozing = object.mbhDozing ?? undefined; + message.mbhIsActive = object.mbhIsActive ?? undefined; + message.mbhCheckStatus = object.mbhCheckStatus ?? undefined; + message.mbhStatus = object.mbhStatus ?? undefined; + message.mbhLdrPrsn = object.mbhLdrPrsn ?? undefined; + message.mbhFinalProduct = object.mbhFinalProduct ?? undefined; + message.mbhCode = object.mbhCode ?? undefined; + message.mbhDevCode = object.mbhDevCode ?? undefined; + message.mbhShadeCode = object.mbhShadeCode ?? undefined; + message.mbhShadeName = object.mbhShadeName ?? undefined; + message.mbhCrossSection = object.mbhCrossSection ?? undefined; + message.mbhLustureCode = object.mbhLustureCode ?? undefined; return message; }, }; -function createBaseUpdateMachineResponse(): UpdateMachineResponse { +function createBaseUpdateMBHeadResponse(): UpdateMBHeadResponse { return { base: undefined, data: undefined }; } -export const UpdateMachineResponse: MessageFns = { - encode(message: UpdateMachineResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const UpdateMBHeadResponse: MessageFns = { + encode(message: UpdateMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } if (message.data !== undefined) { - Machine.encode(message.data, writer.uint32(18).fork()).join(); + MBHead.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateMachineResponse { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMBHeadResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateMachineResponse(); + const message = createBaseUpdateMBHeadResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4209,7 +14853,7 @@ export const UpdateMachineResponse: MessageFns = { break; } - message.data = Machine.decode(reader, reader.uint32()); + message.data = MBHead.decode(reader, reader.uint32()); continue; } } @@ -4221,53 +14865,53 @@ export const UpdateMachineResponse: MessageFns = { return message; }, - fromJSON(object: any): UpdateMachineResponse { + fromJSON(object: any): UpdateMBHeadResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? Machine.fromJSON(object.data) : undefined, + data: isSet(object.data) ? MBHead.fromJSON(object.data) : undefined, }; }, - toJSON(message: UpdateMachineResponse): unknown { + toJSON(message: UpdateMBHeadResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data !== undefined) { - obj.data = Machine.toJSON(message.data); + obj.data = MBHead.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): UpdateMachineResponse { - return UpdateMachineResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateMBHeadResponse { + return UpdateMBHeadResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateMachineResponse { - const message = createBaseUpdateMachineResponse(); + fromPartial(object: DeepPartial): UpdateMBHeadResponse { + const message = createBaseUpdateMBHeadResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) ? Machine.fromPartial(object.data) : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; return message; }, }; -function createBaseDeleteMachineRequest(): DeleteMachineRequest { - return { machineId: "" }; +function createBaseDeleteMBHeadRequest(): DeleteMBHeadRequest { + return { mbhId: "" }; } -export const DeleteMachineRequest: MessageFns = { - encode(message: DeleteMachineRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.machineId !== "") { - writer.uint32(10).string(message.machineId); +export const DeleteMBHeadRequest: MessageFns = { + encode(message: DeleteMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteMachineRequest { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMBHeadRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteMachineRequest(); + const message = createBaseDeleteMBHeadRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4276,7 +14920,7 @@ export const DeleteMachineRequest: MessageFns = { break; } - message.machineId = reader.string(); + message.mbhId = reader.string(); continue; } } @@ -4288,50 +14932,50 @@ export const DeleteMachineRequest: MessageFns = { return message; }, - fromJSON(object: any): DeleteMachineRequest { + fromJSON(object: any): DeleteMBHeadRequest { return { - machineId: isSet(object.machineId) - ? globalThis.String(object.machineId) - : isSet(object.machine_id) - ? globalThis.String(object.machine_id) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) : "", }; }, - toJSON(message: DeleteMachineRequest): unknown { + toJSON(message: DeleteMBHeadRequest): unknown { const obj: any = {}; - if (message.machineId !== "") { - obj.machineId = message.machineId; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } return obj; }, - create(base?: DeepPartial): DeleteMachineRequest { - return DeleteMachineRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMBHeadRequest { + return DeleteMBHeadRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteMachineRequest { - const message = createBaseDeleteMachineRequest(); - message.machineId = object.machineId ?? ""; + fromPartial(object: DeepPartial): DeleteMBHeadRequest { + const message = createBaseDeleteMBHeadRequest(); + message.mbhId = object.mbhId ?? ""; return message; }, }; -function createBaseDeleteMachineResponse(): DeleteMachineResponse { +function createBaseDeleteMBHeadResponse(): DeleteMBHeadResponse { return { base: undefined }; } -export const DeleteMachineResponse: MessageFns = { - encode(message: DeleteMachineResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DeleteMBHeadResponse: MessageFns = { + encode(message: DeleteMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteMachineResponse { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMBHeadResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteMachineResponse(); + const message = createBaseDeleteMBHeadResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4352,11 +14996,11 @@ export const DeleteMachineResponse: MessageFns = { return message; }, - fromJSON(object: any): DeleteMachineResponse { + fromJSON(object: any): DeleteMBHeadResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; }, - toJSON(message: DeleteMachineResponse): unknown { + toJSON(message: DeleteMBHeadResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); @@ -4364,11 +15008,11 @@ export const DeleteMachineResponse: MessageFns = { return obj; }, - create(base?: DeepPartial): DeleteMachineResponse { - return DeleteMachineResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMBHeadResponse { + return DeleteMBHeadResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteMachineResponse { - const message = createBaseDeleteMachineResponse(); + fromPartial(object: DeepPartial): DeleteMBHeadResponse { + const message = createBaseDeleteMBHeadResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; @@ -4376,12 +15020,12 @@ export const DeleteMachineResponse: MessageFns = { }, }; -function createBaseListMachinesRequest(): ListMachinesRequest { - return { page: 0, pageSize: 0, search: "", mcTypeFilter: "", activeFilter: 0, sortBy: "", sortOrder: "" }; +function createBaseListMBHeadsRequest(): ListMBHeadsRequest { + return { page: 0, pageSize: 0, search: "", activeFilter: 0, sortBy: "", sortOrder: "" }; } -export const ListMachinesRequest: MessageFns = { - encode(message: ListMachinesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListMBHeadsRequest: MessageFns = { + encode(message: ListMBHeadsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.page !== 0) { writer.uint32(8).int32(message.page); } @@ -4391,25 +15035,22 @@ export const ListMachinesRequest: MessageFns = { if (message.search !== "") { writer.uint32(26).string(message.search); } - if (message.mcTypeFilter !== "") { - writer.uint32(34).string(message.mcTypeFilter); - } if (message.activeFilter !== 0) { - writer.uint32(40).int32(message.activeFilter); + writer.uint32(32).int32(message.activeFilter); } if (message.sortBy !== "") { - writer.uint32(50).string(message.sortBy); + writer.uint32(42).string(message.sortBy); } if (message.sortOrder !== "") { - writer.uint32(58).string(message.sortOrder); + writer.uint32(50).string(message.sortOrder); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListMachinesRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ListMBHeadsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMachinesRequest(); + const message = createBaseListMBHeadsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4438,19 +15079,19 @@ export const ListMachinesRequest: MessageFns = { continue; } case 4: { - if (tag !== 34) { + if (tag !== 32) { break; } - message.mcTypeFilter = reader.string(); + message.activeFilter = reader.int32() as any; continue; } case 5: { - if (tag !== 40) { + if (tag !== 42) { break; } - message.activeFilter = reader.int32() as any; + message.sortBy = reader.string(); continue; } case 6: { @@ -4458,14 +15099,6 @@ export const ListMachinesRequest: MessageFns = { break; } - message.sortBy = reader.string(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - message.sortOrder = reader.string(); continue; } @@ -4478,7 +15111,7 @@ export const ListMachinesRequest: MessageFns = { return message; }, - fromJSON(object: any): ListMachinesRequest { + fromJSON(object: any): ListMBHeadsRequest { return { page: isSet(object.page) ? globalThis.Number(object.page) : 0, pageSize: isSet(object.pageSize) @@ -4487,11 +15120,6 @@ export const ListMachinesRequest: MessageFns = { ? globalThis.Number(object.page_size) : 0, search: isSet(object.search) ? globalThis.String(object.search) : "", - mcTypeFilter: isSet(object.mcTypeFilter) - ? globalThis.String(object.mcTypeFilter) - : isSet(object.mc_type_filter) - ? globalThis.String(object.mc_type_filter) - : "", activeFilter: isSet(object.activeFilter) ? activeFilterFromJSON(object.activeFilter) : isSet(object.active_filter) @@ -4510,7 +15138,7 @@ export const ListMachinesRequest: MessageFns = { }; }, - toJSON(message: ListMachinesRequest): unknown { + toJSON(message: ListMBHeadsRequest): unknown { const obj: any = {}; if (message.page !== 0) { obj.page = Math.round(message.page); @@ -4521,9 +15149,6 @@ export const ListMachinesRequest: MessageFns = { if (message.search !== "") { obj.search = message.search; } - if (message.mcTypeFilter !== "") { - obj.mcTypeFilter = message.mcTypeFilter; - } if (message.activeFilter !== 0) { obj.activeFilter = activeFilterToJSON(message.activeFilter); } @@ -4536,15 +15161,14 @@ export const ListMachinesRequest: MessageFns = { return obj; }, - create(base?: DeepPartial): ListMachinesRequest { - return ListMachinesRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMBHeadsRequest { + return ListMBHeadsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListMachinesRequest { - const message = createBaseListMachinesRequest(); + fromPartial(object: DeepPartial): ListMBHeadsRequest { + const message = createBaseListMBHeadsRequest(); message.page = object.page ?? 0; message.pageSize = object.pageSize ?? 0; message.search = object.search ?? ""; - message.mcTypeFilter = object.mcTypeFilter ?? ""; message.activeFilter = object.activeFilter ?? 0; message.sortBy = object.sortBy ?? ""; message.sortOrder = object.sortOrder ?? ""; @@ -4552,17 +15176,17 @@ export const ListMachinesRequest: MessageFns = { }, }; -function createBaseListMachinesResponse(): ListMachinesResponse { +function createBaseListMBHeadsResponse(): ListMBHeadsResponse { return { base: undefined, data: [], pagination: undefined }; } -export const ListMachinesResponse: MessageFns = { - encode(message: ListMachinesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListMBHeadsResponse: MessageFns = { + encode(message: ListMBHeadsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } for (const v of message.data) { - Machine.encode(v!, writer.uint32(18).fork()).join(); + MBHead.encode(v!, writer.uint32(18).fork()).join(); } if (message.pagination !== undefined) { PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); @@ -4570,10 +15194,10 @@ export const ListMachinesResponse: MessageFns = { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListMachinesResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListMBHeadsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMachinesResponse(); + const message = createBaseListMBHeadsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4590,7 +15214,7 @@ export const ListMachinesResponse: MessageFns = { break; } - message.data.push(Machine.decode(reader, reader.uint32())); + message.data.push(MBHead.decode(reader, reader.uint32())); continue; } case 3: { @@ -4610,21 +15234,21 @@ export const ListMachinesResponse: MessageFns = { return message; }, - fromJSON(object: any): ListMachinesResponse { + fromJSON(object: any): ListMBHeadsResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => Machine.fromJSON(e)) : [], + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MBHead.fromJSON(e)) : [], pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: ListMachinesResponse): unknown { + toJSON(message: ListMBHeadsResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data?.length) { - obj.data = message.data.map((e) => Machine.toJSON(e)); + obj.data = message.data.map((e) => MBHead.toJSON(e)); } if (message.pagination !== undefined) { obj.pagination = PaginationResponse.toJSON(message.pagination); @@ -4632,15 +15256,15 @@ export const ListMachinesResponse: MessageFns = { return obj; }, - create(base?: DeepPartial): ListMachinesResponse { - return ListMachinesResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMBHeadsResponse { + return ListMBHeadsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListMachinesResponse { - const message = createBaseListMachinesResponse(); + fromPartial(object: DeepPartial): ListMBHeadsResponse { + const message = createBaseListMBHeadsResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = object.data?.map((e) => Machine.fromPartial(e)) || []; + message.data = object.data?.map((e) => MBHead.fromPartial(e)) || []; message.pagination = (object.pagination !== undefined && object.pagination !== null) ? PaginationResponse.fromPartial(object.pagination) : undefined; @@ -4648,22 +15272,22 @@ export const ListMachinesResponse: MessageFns = { }, }; -function createBaseExportMachinesRequest(): ExportMachinesRequest { +function createBaseExportMBHeadsRequest(): ExportMBHeadsRequest { return { activeFilter: 0 }; } -export const ExportMachinesRequest: MessageFns = { - encode(message: ExportMachinesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ExportMBHeadsRequest: MessageFns = { + encode(message: ExportMBHeadsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.activeFilter !== 0) { writer.uint32(8).int32(message.activeFilter); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportMachinesRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ExportMBHeadsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportMachinesRequest(); + const message = createBaseExportMBHeadsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4684,7 +15308,7 @@ export const ExportMachinesRequest: MessageFns = { return message; }, - fromJSON(object: any): ExportMachinesRequest { + fromJSON(object: any): ExportMBHeadsRequest { return { activeFilter: isSet(object.activeFilter) ? activeFilterFromJSON(object.activeFilter) @@ -4694,7 +15318,7 @@ export const ExportMachinesRequest: MessageFns = { }; }, - toJSON(message: ExportMachinesRequest): unknown { + toJSON(message: ExportMBHeadsRequest): unknown { const obj: any = {}; if (message.activeFilter !== 0) { obj.activeFilter = activeFilterToJSON(message.activeFilter); @@ -4702,22 +15326,22 @@ export const ExportMachinesRequest: MessageFns = { return obj; }, - create(base?: DeepPartial): ExportMachinesRequest { - return ExportMachinesRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ExportMBHeadsRequest { + return ExportMBHeadsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportMachinesRequest { - const message = createBaseExportMachinesRequest(); + fromPartial(object: DeepPartial): ExportMBHeadsRequest { + const message = createBaseExportMBHeadsRequest(); message.activeFilter = object.activeFilter ?? 0; return message; }, }; -function createBaseExportMachinesResponse(): ExportMachinesResponse { +function createBaseExportMBHeadsResponse(): ExportMBHeadsResponse { return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; } -export const ExportMachinesResponse: MessageFns = { - encode(message: ExportMachinesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ExportMBHeadsResponse: MessageFns = { + encode(message: ExportMBHeadsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } @@ -4730,10 +15354,10 @@ export const ExportMachinesResponse: MessageFns = { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportMachinesResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ExportMBHeadsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportMachinesResponse(); + const message = createBaseExportMBHeadsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4770,7 +15394,7 @@ export const ExportMachinesResponse: MessageFns = { return message; }, - fromJSON(object: any): ExportMachinesResponse { + fromJSON(object: any): ExportMBHeadsResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, fileContent: isSet(object.fileContent) @@ -4786,7 +15410,7 @@ export const ExportMachinesResponse: MessageFns = { }; }, - toJSON(message: ExportMachinesResponse): unknown { + toJSON(message: ExportMBHeadsResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); @@ -4800,11 +15424,11 @@ export const ExportMachinesResponse: MessageFns = { return obj; }, - create(base?: DeepPartial): ExportMachinesResponse { - return ExportMachinesResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ExportMBHeadsResponse { + return ExportMBHeadsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportMachinesResponse { - const message = createBaseExportMachinesResponse(); + fromPartial(object: DeepPartial): ExportMBHeadsResponse { + const message = createBaseExportMBHeadsResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; @@ -4814,12 +15438,12 @@ export const ExportMachinesResponse: MessageFns = { }, }; -function createBaseImportMachinesRequest(): ImportMachinesRequest { +function createBaseImportMBHeadsRequest(): ImportMBHeadsRequest { return { fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; } -export const ImportMachinesRequest: MessageFns = { - encode(message: ImportMachinesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ImportMBHeadsRequest: MessageFns = { + encode(message: ImportMBHeadsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.fileContent.length !== 0) { writer.uint32(10).bytes(message.fileContent); } @@ -4832,10 +15456,10 @@ export const ImportMachinesRequest: MessageFns = { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportMachinesRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ImportMBHeadsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportMachinesRequest(); + const message = createBaseImportMBHeadsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4872,7 +15496,7 @@ export const ImportMachinesRequest: MessageFns = { return message; }, - fromJSON(object: any): ImportMachinesRequest { + fromJSON(object: any): ImportMBHeadsRequest { return { fileContent: isSet(object.fileContent) ? bytesFromBase64(object.fileContent) @@ -4892,7 +15516,7 @@ export const ImportMachinesRequest: MessageFns = { }; }, - toJSON(message: ImportMachinesRequest): unknown { + toJSON(message: ImportMBHeadsRequest): unknown { const obj: any = {}; if (message.fileContent.length !== 0) { obj.fileContent = base64FromBytes(message.fileContent); @@ -4905,12 +15529,12 @@ export const ImportMachinesRequest: MessageFns = { } return obj; }, - - create(base?: DeepPartial): ImportMachinesRequest { - return ImportMachinesRequest.fromPartial(base ?? {}); + + create(base?: DeepPartial): ImportMBHeadsRequest { + return ImportMBHeadsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ImportMachinesRequest { - const message = createBaseImportMachinesRequest(); + fromPartial(object: DeepPartial): ImportMBHeadsRequest { + const message = createBaseImportMBHeadsRequest(); message.fileContent = object.fileContent ?? new Uint8Array(0); message.fileName = object.fileName ?? ""; message.duplicateAction = object.duplicateAction ?? ""; @@ -4918,12 +15542,12 @@ export const ImportMachinesRequest: MessageFns = { }, }; -function createBaseImportMachinesResponse(): ImportMachinesResponse { +function createBaseImportMBHeadsResponse(): ImportMBHeadsResponse { return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; } -export const ImportMachinesResponse: MessageFns = { - encode(message: ImportMachinesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ImportMBHeadsResponse: MessageFns = { + encode(message: ImportMBHeadsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } @@ -4942,10 +15566,10 @@ export const ImportMachinesResponse: MessageFns = { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportMachinesResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ImportMBHeadsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportMachinesResponse(); + const message = createBaseImportMBHeadsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -4998,7 +15622,7 @@ export const ImportMachinesResponse: MessageFns = { return message; }, - fromJSON(object: any): ImportMachinesResponse { + fromJSON(object: any): ImportMBHeadsResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, successCount: isSet(object.successCount) @@ -5020,7 +15644,7 @@ export const ImportMachinesResponse: MessageFns = { }; }, - toJSON(message: ImportMachinesResponse): unknown { + toJSON(message: ImportMBHeadsResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); @@ -5040,11 +15664,11 @@ export const ImportMachinesResponse: MessageFns = { return obj; }, - create(base?: DeepPartial): ImportMachinesResponse { - return ImportMachinesResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ImportMBHeadsResponse { + return ImportMBHeadsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ImportMachinesResponse { - const message = createBaseImportMachinesResponse(); + fromPartial(object: DeepPartial): ImportMBHeadsResponse { + const message = createBaseImportMBHeadsResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; @@ -5056,19 +15680,19 @@ export const ImportMachinesResponse: MessageFns = { }, }; -function createBaseDownloadMachineTemplateRequest(): DownloadMachineTemplateRequest { +function createBaseDownloadMBHeadTemplateRequest(): DownloadMBHeadTemplateRequest { return {}; } -export const DownloadMachineTemplateRequest: MessageFns = { - encode(_: DownloadMachineTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DownloadMBHeadTemplateRequest: MessageFns = { + encode(_: DownloadMBHeadTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DownloadMachineTemplateRequest { + decode(input: BinaryReader | Uint8Array, length?: number): DownloadMBHeadTemplateRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDownloadMachineTemplateRequest(); + const message = createBaseDownloadMBHeadTemplateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5081,30 +15705,30 @@ export const DownloadMachineTemplateRequest: MessageFns): DownloadMachineTemplateRequest { - return DownloadMachineTemplateRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): DownloadMBHeadTemplateRequest { + return DownloadMBHeadTemplateRequest.fromPartial(base ?? {}); }, - fromPartial(_: DeepPartial): DownloadMachineTemplateRequest { - const message = createBaseDownloadMachineTemplateRequest(); + fromPartial(_: DeepPartial): DownloadMBHeadTemplateRequest { + const message = createBaseDownloadMBHeadTemplateRequest(); return message; }, }; -function createBaseDownloadMachineTemplateResponse(): DownloadMachineTemplateResponse { +function createBaseDownloadMBHeadTemplateResponse(): DownloadMBHeadTemplateResponse { return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; } -export const DownloadMachineTemplateResponse: MessageFns = { - encode(message: DownloadMachineTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DownloadMBHeadTemplateResponse: MessageFns = { + encode(message: DownloadMBHeadTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } @@ -5117,10 +15741,10 @@ export const DownloadMachineTemplateResponse: MessageFns>> 3) { @@ -5157,7 +15781,7 @@ export const DownloadMachineTemplateResponse: MessageFns): DownloadMachineTemplateResponse { - return DownloadMachineTemplateResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): DownloadMBHeadTemplateResponse { + return DownloadMBHeadTemplateResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DownloadMachineTemplateResponse { - const message = createBaseDownloadMachineTemplateResponse(); + fromPartial(object: DeepPartial): DownloadMBHeadTemplateResponse { + const message = createBaseDownloadMBHeadTemplateResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; @@ -5201,52 +15825,22 @@ export const DownloadMachineTemplateResponse: MessageFns = { - encode(message: BoxBobbinCostRate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.bbcrId !== "") { - writer.uint32(10).string(message.bbcrId); - } - if (message.bbcrBbcId !== "") { - writer.uint32(18).string(message.bbcrBbcId); - } - if (message.bbcrPeriod !== "") { - writer.uint32(26).string(message.bbcrPeriod); - } - if (message.bbcrBobRateMkt !== 0) { - writer.uint32(33).double(message.bbcrBobRateMkt); - } - if (message.bbcrBoxRateMkt !== 0) { - writer.uint32(41).double(message.bbcrBoxRateMkt); - } - if (message.bbcrBobRateVal !== undefined) { - writer.uint32(49).double(message.bbcrBobRateVal); - } - if (message.bbcrBoxRateVal !== undefined) { - writer.uint32(57).double(message.bbcrBoxRateVal); - } - if (message.audit !== undefined) { - AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); +export const SubmitMBHeadRequest: MessageFns = { + encode(message: SubmitMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): BoxBobbinCostRate { + decode(input: BinaryReader | Uint8Array, length?: number): SubmitMBHeadRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBoxBobbinCostRate(); + const message = createBaseSubmitMBHeadRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5255,63 +15849,7 @@ export const BoxBobbinCostRate: MessageFns = { break; } - message.bbcrId = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.bbcrBbcId = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.bbcrPeriod = reader.string(); - continue; - } - case 4: { - if (tag !== 33) { - break; - } - - message.bbcrBobRateMkt = reader.double(); - continue; - } - case 5: { - if (tag !== 41) { - break; - } - - message.bbcrBoxRateMkt = reader.double(); - continue; - } - case 6: { - if (tag !== 49) { - break; - } - - message.bbcrBobRateVal = reader.double(); - continue; - } - case 7: { - if (tag !== 57) { - break; - } - - message.bbcrBoxRateVal = reader.double(); - continue; - } - case 16: { - if (tag !== 130) { - break; - } - - message.audit = AuditInfo.decode(reader, reader.uint32()); + message.mbhId = reader.string(); continue; } } @@ -5323,177 +15861,53 @@ export const BoxBobbinCostRate: MessageFns = { return message; }, - fromJSON(object: any): BoxBobbinCostRate { + fromJSON(object: any): SubmitMBHeadRequest { return { - bbcrId: isSet(object.bbcrId) - ? globalThis.String(object.bbcrId) - : isSet(object.bbcr_id) - ? globalThis.String(object.bbcr_id) - : "", - bbcrBbcId: isSet(object.bbcrBbcId) - ? globalThis.String(object.bbcrBbcId) - : isSet(object.bbcr_bbc_id) - ? globalThis.String(object.bbcr_bbc_id) - : "", - bbcrPeriod: isSet(object.bbcrPeriod) - ? globalThis.String(object.bbcrPeriod) - : isSet(object.bbcr_period) - ? globalThis.String(object.bbcr_period) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) : "", - bbcrBobRateMkt: isSet(object.bbcrBobRateMkt) - ? globalThis.Number(object.bbcrBobRateMkt) - : isSet(object.bbcr_bob_rate_mkt) - ? globalThis.Number(object.bbcr_bob_rate_mkt) - : 0, - bbcrBoxRateMkt: isSet(object.bbcrBoxRateMkt) - ? globalThis.Number(object.bbcrBoxRateMkt) - : isSet(object.bbcr_box_rate_mkt) - ? globalThis.Number(object.bbcr_box_rate_mkt) - : 0, - bbcrBobRateVal: isSet(object.bbcrBobRateVal) - ? globalThis.Number(object.bbcrBobRateVal) - : isSet(object.bbcr_bob_rate_val) - ? globalThis.Number(object.bbcr_bob_rate_val) - : undefined, - bbcrBoxRateVal: isSet(object.bbcrBoxRateVal) - ? globalThis.Number(object.bbcrBoxRateVal) - : isSet(object.bbcr_box_rate_val) - ? globalThis.Number(object.bbcr_box_rate_val) - : undefined, - audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, }; }, - toJSON(message: BoxBobbinCostRate): unknown { - const obj: any = {}; - if (message.bbcrId !== "") { - obj.bbcrId = message.bbcrId; - } - if (message.bbcrBbcId !== "") { - obj.bbcrBbcId = message.bbcrBbcId; - } - if (message.bbcrPeriod !== "") { - obj.bbcrPeriod = message.bbcrPeriod; - } - if (message.bbcrBobRateMkt !== 0) { - obj.bbcrBobRateMkt = message.bbcrBobRateMkt; - } - if (message.bbcrBoxRateMkt !== 0) { - obj.bbcrBoxRateMkt = message.bbcrBoxRateMkt; - } - if (message.bbcrBobRateVal !== undefined) { - obj.bbcrBobRateVal = message.bbcrBobRateVal; - } - if (message.bbcrBoxRateVal !== undefined) { - obj.bbcrBoxRateVal = message.bbcrBoxRateVal; - } - if (message.audit !== undefined) { - obj.audit = AuditInfo.toJSON(message.audit); - } - return obj; - }, - - create(base?: DeepPartial): BoxBobbinCostRate { - return BoxBobbinCostRate.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): BoxBobbinCostRate { - const message = createBaseBoxBobbinCostRate(); - message.bbcrId = object.bbcrId ?? ""; - message.bbcrBbcId = object.bbcrBbcId ?? ""; - message.bbcrPeriod = object.bbcrPeriod ?? ""; - message.bbcrBobRateMkt = object.bbcrBobRateMkt ?? 0; - message.bbcrBoxRateMkt = object.bbcrBoxRateMkt ?? 0; - message.bbcrBobRateVal = object.bbcrBobRateVal ?? undefined; - message.bbcrBoxRateVal = object.bbcrBoxRateVal ?? undefined; - message.audit = (object.audit !== undefined && object.audit !== null) - ? AuditInfo.fromPartial(object.audit) - : undefined; + toJSON(message: SubmitMBHeadRequest): unknown { + const obj: any = {}; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; + } + return obj; + }, + + create(base?: DeepPartial): SubmitMBHeadRequest { + return SubmitMBHeadRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SubmitMBHeadRequest { + const message = createBaseSubmitMBHeadRequest(); + message.mbhId = object.mbhId ?? ""; return message; }, }; -function createBaseBoxBobbinCost(): BoxBobbinCost { - return { - bbcId: "", - bbcCode: "", - bbcName: "", - bbcType: "", - noOfBob: 0, - isActive: false, - notes: "", - rates: [], - bbnReuse: undefined, - boxReuse: undefined, - boxCost: undefined, - bobinCost: undefined, - boxCostVal: undefined, - bobinCostVal: undefined, - bbnReuseVal: undefined, - audit: undefined, - boxReuseVal: undefined, - }; +function createBaseSubmitMBHeadResponse(): SubmitMBHeadResponse { + return { base: undefined, data: undefined }; } -export const BoxBobbinCost: MessageFns = { - encode(message: BoxBobbinCost, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.bbcId !== "") { - writer.uint32(10).string(message.bbcId); - } - if (message.bbcCode !== "") { - writer.uint32(18).string(message.bbcCode); - } - if (message.bbcName !== "") { - writer.uint32(26).string(message.bbcName); - } - if (message.bbcType !== "") { - writer.uint32(34).string(message.bbcType); - } - if (message.noOfBob !== 0) { - writer.uint32(40).int32(message.noOfBob); - } - if (message.isActive !== false) { - writer.uint32(48).bool(message.isActive); - } - if (message.notes !== "") { - writer.uint32(58).string(message.notes); - } - for (const v of message.rates) { - BoxBobbinCostRate.encode(v!, writer.uint32(66).fork()).join(); - } - if (message.bbnReuse !== undefined) { - writer.uint32(73).double(message.bbnReuse); - } - if (message.boxReuse !== undefined) { - writer.uint32(81).double(message.boxReuse); - } - if (message.boxCost !== undefined) { - writer.uint32(89).double(message.boxCost); - } - if (message.bobinCost !== undefined) { - writer.uint32(97).double(message.bobinCost); - } - if (message.boxCostVal !== undefined) { - writer.uint32(105).double(message.boxCostVal); - } - if (message.bobinCostVal !== undefined) { - writer.uint32(113).double(message.bobinCostVal); - } - if (message.bbnReuseVal !== undefined) { - writer.uint32(121).double(message.bbnReuseVal); - } - if (message.audit !== undefined) { - AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); +export const SubmitMBHeadResponse: MessageFns = { + encode(message: SubmitMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.boxReuseVal !== undefined) { - writer.uint32(137).double(message.boxReuseVal); + if (message.data !== undefined) { + MBHead.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): BoxBobbinCost { + decode(input: BinaryReader | Uint8Array, length?: number): SubmitMBHeadResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseBoxBobbinCost(); + const message = createBaseSubmitMBHeadResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5502,7 +15916,7 @@ export const BoxBobbinCost: MessageFns = { break; } - message.bbcId = reader.string(); + message.base = BaseResponse.decode(reader, reader.uint32()); continue; } case 2: { @@ -5510,127 +15924,149 @@ export const BoxBobbinCost: MessageFns = { break; } - message.bbcCode = reader.string(); + message.data = MBHead.decode(reader, reader.uint32()); continue; } - case 3: { - if (tag !== 26) { - break; - } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, - message.bbcName = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } + fromJSON(object: any): SubmitMBHeadResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? MBHead.fromJSON(object.data) : undefined, + }; + }, - message.bbcType = reader.string(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } + toJSON(message: SubmitMBHeadResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = MBHead.toJSON(message.data); + } + return obj; + }, - message.noOfBob = reader.int32(); - continue; - } - case 6: { - if (tag !== 48) { - break; - } + create(base?: DeepPartial): SubmitMBHeadResponse { + return SubmitMBHeadResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): SubmitMBHeadResponse { + const message = createBaseSubmitMBHeadResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; + return message; + }, +}; - message.isActive = reader.bool(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } +function createBaseApproveMBHeadRequest(): ApproveMBHeadRequest { + return { mbhId: "" }; +} - message.notes = reader.string(); - continue; - } - case 8: { - if (tag !== 66) { - break; - } +export const ApproveMBHeadRequest: MessageFns = { + encode(message: ApproveMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); + } + return writer; + }, - message.rates.push(BoxBobbinCostRate.decode(reader, reader.uint32())); - continue; - } - case 9: { - if (tag !== 73) { + decode(input: BinaryReader | Uint8Array, length?: number): ApproveMBHeadRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseApproveMBHeadRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { break; } - message.bbnReuse = reader.double(); + message.mbhId = reader.string(); continue; } - case 10: { - if (tag !== 81) { - break; - } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, - message.boxReuse = reader.double(); - continue; - } - case 11: { - if (tag !== 89) { - break; - } + fromJSON(object: any): ApproveMBHeadRequest { + return { + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + }; + }, - message.boxCost = reader.double(); - continue; - } - case 12: { - if (tag !== 97) { - break; - } + toJSON(message: ApproveMBHeadRequest): unknown { + const obj: any = {}; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; + } + return obj; + }, - message.bobinCost = reader.double(); - continue; - } - case 13: { - if (tag !== 105) { - break; - } + create(base?: DeepPartial): ApproveMBHeadRequest { + return ApproveMBHeadRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ApproveMBHeadRequest { + const message = createBaseApproveMBHeadRequest(); + message.mbhId = object.mbhId ?? ""; + return message; + }, +}; - message.boxCostVal = reader.double(); - continue; - } - case 14: { - if (tag !== 113) { - break; - } +function createBaseApproveMBHeadResponse(): ApproveMBHeadResponse { + return { base: undefined, data: undefined }; +} - message.bobinCostVal = reader.double(); - continue; - } - case 15: { - if (tag !== 121) { - break; - } +export const ApproveMBHeadResponse: MessageFns = { + encode(message: ApproveMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + MBHead.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, - message.bbnReuseVal = reader.double(); - continue; - } - case 16: { - if (tag !== 130) { + decode(input: BinaryReader | Uint8Array, length?: number): ApproveMBHeadResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseApproveMBHeadResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { break; } - message.audit = AuditInfo.decode(reader, reader.uint32()); + message.base = BaseResponse.decode(reader, reader.uint32()); continue; } - case 17: { - if (tag !== 137) { + case 2: { + if (tag !== 18) { break; } - message.boxReuseVal = reader.double(); + message.data = MBHead.decode(reader, reader.uint32()); continue; } } @@ -5642,236 +16078,120 @@ export const BoxBobbinCost: MessageFns = { return message; }, - fromJSON(object: any): BoxBobbinCost { + fromJSON(object: any): ApproveMBHeadResponse { return { - bbcId: isSet(object.bbcId) - ? globalThis.String(object.bbcId) - : isSet(object.bbc_id) - ? globalThis.String(object.bbc_id) - : "", - bbcCode: isSet(object.bbcCode) - ? globalThis.String(object.bbcCode) - : isSet(object.bbc_code) - ? globalThis.String(object.bbc_code) - : "", - bbcName: isSet(object.bbcName) - ? globalThis.String(object.bbcName) - : isSet(object.bbc_name) - ? globalThis.String(object.bbc_name) - : "", - bbcType: isSet(object.bbcType) - ? globalThis.String(object.bbcType) - : isSet(object.bbc_type) - ? globalThis.String(object.bbc_type) - : "", - noOfBob: isSet(object.noOfBob) - ? globalThis.Number(object.noOfBob) - : isSet(object.no_of_bob) - ? globalThis.Number(object.no_of_bob) - : 0, - isActive: isSet(object.isActive) - ? globalThis.Boolean(object.isActive) - : isSet(object.is_active) - ? globalThis.Boolean(object.is_active) - : false, - notes: isSet(object.notes) ? globalThis.String(object.notes) : "", - rates: globalThis.Array.isArray(object?.rates) - ? object.rates.map((e: any) => BoxBobbinCostRate.fromJSON(e)) - : [], - bbnReuse: isSet(object.bbnReuse) - ? globalThis.Number(object.bbnReuse) - : isSet(object.bbn_reuse) - ? globalThis.Number(object.bbn_reuse) - : undefined, - boxReuse: isSet(object.boxReuse) - ? globalThis.Number(object.boxReuse) - : isSet(object.box_reuse) - ? globalThis.Number(object.box_reuse) - : undefined, - boxCost: isSet(object.boxCost) - ? globalThis.Number(object.boxCost) - : isSet(object.box_cost) - ? globalThis.Number(object.box_cost) - : undefined, - bobinCost: isSet(object.bobinCost) - ? globalThis.Number(object.bobinCost) - : isSet(object.bobin_cost) - ? globalThis.Number(object.bobin_cost) - : undefined, - boxCostVal: isSet(object.boxCostVal) - ? globalThis.Number(object.boxCostVal) - : isSet(object.box_cost_val) - ? globalThis.Number(object.box_cost_val) - : undefined, - bobinCostVal: isSet(object.bobinCostVal) - ? globalThis.Number(object.bobinCostVal) - : isSet(object.bobin_cost_val) - ? globalThis.Number(object.bobin_cost_val) - : undefined, - bbnReuseVal: isSet(object.bbnReuseVal) - ? globalThis.Number(object.bbnReuseVal) - : isSet(object.bbn_reuse_val) - ? globalThis.Number(object.bbn_reuse_val) - : undefined, - audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, - boxReuseVal: isSet(object.boxReuseVal) - ? globalThis.Number(object.boxReuseVal) - : isSet(object.box_reuse_val) - ? globalThis.Number(object.box_reuse_val) - : undefined, + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? MBHead.fromJSON(object.data) : undefined, }; }, - toJSON(message: BoxBobbinCost): unknown { + toJSON(message: ApproveMBHeadResponse): unknown { const obj: any = {}; - if (message.bbcId !== "") { - obj.bbcId = message.bbcId; - } - if (message.bbcCode !== "") { - obj.bbcCode = message.bbcCode; - } - if (message.bbcName !== "") { - obj.bbcName = message.bbcName; - } - if (message.bbcType !== "") { - obj.bbcType = message.bbcType; - } - if (message.noOfBob !== 0) { - obj.noOfBob = Math.round(message.noOfBob); - } - if (message.isActive !== false) { - obj.isActive = message.isActive; - } - if (message.notes !== "") { - obj.notes = message.notes; - } - if (message.rates?.length) { - obj.rates = message.rates.map((e) => BoxBobbinCostRate.toJSON(e)); - } - if (message.bbnReuse !== undefined) { - obj.bbnReuse = message.bbnReuse; - } - if (message.boxReuse !== undefined) { - obj.boxReuse = message.boxReuse; - } - if (message.boxCost !== undefined) { - obj.boxCost = message.boxCost; - } - if (message.bobinCost !== undefined) { - obj.bobinCost = message.bobinCost; - } - if (message.boxCostVal !== undefined) { - obj.boxCostVal = message.boxCostVal; - } - if (message.bobinCostVal !== undefined) { - obj.bobinCostVal = message.bobinCostVal; - } - if (message.bbnReuseVal !== undefined) { - obj.bbnReuseVal = message.bbnReuseVal; - } - if (message.audit !== undefined) { - obj.audit = AuditInfo.toJSON(message.audit); + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); } - if (message.boxReuseVal !== undefined) { - obj.boxReuseVal = message.boxReuseVal; + if (message.data !== undefined) { + obj.data = MBHead.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): BoxBobbinCost { - return BoxBobbinCost.fromPartial(base ?? {}); + create(base?: DeepPartial): ApproveMBHeadResponse { + return ApproveMBHeadResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): BoxBobbinCost { - const message = createBaseBoxBobbinCost(); - message.bbcId = object.bbcId ?? ""; - message.bbcCode = object.bbcCode ?? ""; - message.bbcName = object.bbcName ?? ""; - message.bbcType = object.bbcType ?? ""; - message.noOfBob = object.noOfBob ?? 0; - message.isActive = object.isActive ?? false; - message.notes = object.notes ?? ""; - message.rates = object.rates?.map((e) => BoxBobbinCostRate.fromPartial(e)) || []; - message.bbnReuse = object.bbnReuse ?? undefined; - message.boxReuse = object.boxReuse ?? undefined; - message.boxCost = object.boxCost ?? undefined; - message.bobinCost = object.bobinCost ?? undefined; - message.boxCostVal = object.boxCostVal ?? undefined; - message.bobinCostVal = object.bobinCostVal ?? undefined; - message.bbnReuseVal = object.bbnReuseVal ?? undefined; - message.audit = (object.audit !== undefined && object.audit !== null) - ? AuditInfo.fromPartial(object.audit) + fromPartial(object: DeepPartial): ApproveMBHeadResponse { + const message = createBaseApproveMBHeadResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) : undefined; - message.boxReuseVal = object.boxReuseVal ?? undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; return message; }, }; -function createBaseCreateBoxBobbinCostRequest(): CreateBoxBobbinCostRequest { - return { - bbcCode: "", - bbcName: "", - bbcType: "", - noOfBob: 0, - notes: "", - bbnReuse: undefined, - boxReuse: undefined, - boxCost: undefined, - bobinCost: undefined, - boxCostVal: undefined, - bobinCostVal: undefined, - bbnReuseVal: undefined, - boxReuseVal: undefined, - }; +function createBaseValidateMBHeadRequest(): ValidateMBHeadRequest { + return { mbhId: "" }; } -export const CreateBoxBobbinCostRequest: MessageFns = { - encode(message: CreateBoxBobbinCostRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.bbcCode !== "") { - writer.uint32(10).string(message.bbcCode); - } - if (message.bbcName !== "") { - writer.uint32(18).string(message.bbcName); - } - if (message.bbcType !== "") { - writer.uint32(26).string(message.bbcType); - } - if (message.noOfBob !== 0) { - writer.uint32(32).int32(message.noOfBob); - } - if (message.notes !== "") { - writer.uint32(42).string(message.notes); - } - if (message.bbnReuse !== undefined) { - writer.uint32(49).double(message.bbnReuse); - } - if (message.boxReuse !== undefined) { - writer.uint32(57).double(message.boxReuse); - } - if (message.boxCost !== undefined) { - writer.uint32(65).double(message.boxCost); - } - if (message.bobinCost !== undefined) { - writer.uint32(73).double(message.bobinCost); +export const ValidateMBHeadRequest: MessageFns = { + encode(message: ValidateMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } - if (message.boxCostVal !== undefined) { - writer.uint32(81).double(message.boxCostVal); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ValidateMBHeadRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseValidateMBHeadRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.mbhId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } - if (message.bobinCostVal !== undefined) { - writer.uint32(89).double(message.bobinCostVal); + return message; + }, + + fromJSON(object: any): ValidateMBHeadRequest { + return { + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + }; + }, + + toJSON(message: ValidateMBHeadRequest): unknown { + const obj: any = {}; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } - if (message.bbnReuseVal !== undefined) { - writer.uint32(97).double(message.bbnReuseVal); + return obj; + }, + + create(base?: DeepPartial): ValidateMBHeadRequest { + return ValidateMBHeadRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ValidateMBHeadRequest { + const message = createBaseValidateMBHeadRequest(); + message.mbhId = object.mbhId ?? ""; + return message; + }, +}; + +function createBaseValidateMBHeadResponse(): ValidateMBHeadResponse { + return { base: undefined, data: undefined }; +} + +export const ValidateMBHeadResponse: MessageFns = { + encode(message: ValidateMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.boxReuseVal !== undefined) { - writer.uint32(105).double(message.boxReuseVal); + if (message.data !== undefined) { + MBHead.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateBoxBobbinCostRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ValidateMBHeadResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateBoxBobbinCostRequest(); + const message = createBaseValidateMBHeadResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -5880,7 +16200,7 @@ export const CreateBoxBobbinCostRequest: MessageFns break; } - message.bbcCode = reader.string(); + message.base = BaseResponse.decode(reader, reader.uint32()); continue; } case 2: { @@ -5888,95 +16208,85 @@ export const CreateBoxBobbinCostRequest: MessageFns break; } - message.bbcName = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.bbcType = reader.string(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.noOfBob = reader.int32(); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.notes = reader.string(); + message.data = MBHead.decode(reader, reader.uint32()); continue; } - case 6: { - if (tag !== 49) { - break; - } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, - message.bbnReuse = reader.double(); - continue; - } - case 7: { - if (tag !== 57) { - break; - } + fromJSON(object: any): ValidateMBHeadResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? MBHead.fromJSON(object.data) : undefined, + }; + }, - message.boxReuse = reader.double(); - continue; - } - case 8: { - if (tag !== 65) { - break; - } + toJSON(message: ValidateMBHeadResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = MBHead.toJSON(message.data); + } + return obj; + }, - message.boxCost = reader.double(); - continue; - } - case 9: { - if (tag !== 73) { - break; - } + create(base?: DeepPartial): ValidateMBHeadResponse { + return ValidateMBHeadResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ValidateMBHeadResponse { + const message = createBaseValidateMBHeadResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; + return message; + }, +}; - message.bobinCost = reader.double(); - continue; - } - case 10: { - if (tag !== 81) { - break; - } +function createBaseUnApproveMBHeadRequest(): UnApproveMBHeadRequest { + return { mbhId: "", reason: "" }; +} - message.boxCostVal = reader.double(); - continue; - } - case 11: { - if (tag !== 89) { - break; - } +export const UnApproveMBHeadRequest: MessageFns = { + encode(message: UnApproveMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); + } + if (message.reason !== "") { + writer.uint32(18).string(message.reason); + } + return writer; + }, - message.bobinCostVal = reader.double(); - continue; - } - case 12: { - if (tag !== 97) { + decode(input: BinaryReader | Uint8Array, length?: number): UnApproveMBHeadRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnApproveMBHeadRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { break; } - message.bbnReuseVal = reader.double(); + message.mbhId = reader.string(); continue; } - case 13: { - if (tag !== 105) { + case 2: { + if (tag !== 18) { break; } - message.boxReuseVal = reader.double(); + message.reason = reader.string(); continue; } } @@ -5988,157 +16298,58 @@ export const CreateBoxBobbinCostRequest: MessageFns return message; }, - fromJSON(object: any): CreateBoxBobbinCostRequest { + fromJSON(object: any): UnApproveMBHeadRequest { return { - bbcCode: isSet(object.bbcCode) - ? globalThis.String(object.bbcCode) - : isSet(object.bbc_code) - ? globalThis.String(object.bbc_code) - : "", - bbcName: isSet(object.bbcName) - ? globalThis.String(object.bbcName) - : isSet(object.bbc_name) - ? globalThis.String(object.bbc_name) - : "", - bbcType: isSet(object.bbcType) - ? globalThis.String(object.bbcType) - : isSet(object.bbc_type) - ? globalThis.String(object.bbc_type) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) : "", - noOfBob: isSet(object.noOfBob) - ? globalThis.Number(object.noOfBob) - : isSet(object.no_of_bob) - ? globalThis.Number(object.no_of_bob) - : 0, - notes: isSet(object.notes) ? globalThis.String(object.notes) : "", - bbnReuse: isSet(object.bbnReuse) - ? globalThis.Number(object.bbnReuse) - : isSet(object.bbn_reuse) - ? globalThis.Number(object.bbn_reuse) - : undefined, - boxReuse: isSet(object.boxReuse) - ? globalThis.Number(object.boxReuse) - : isSet(object.box_reuse) - ? globalThis.Number(object.box_reuse) - : undefined, - boxCost: isSet(object.boxCost) - ? globalThis.Number(object.boxCost) - : isSet(object.box_cost) - ? globalThis.Number(object.box_cost) - : undefined, - bobinCost: isSet(object.bobinCost) - ? globalThis.Number(object.bobinCost) - : isSet(object.bobin_cost) - ? globalThis.Number(object.bobin_cost) - : undefined, - boxCostVal: isSet(object.boxCostVal) - ? globalThis.Number(object.boxCostVal) - : isSet(object.box_cost_val) - ? globalThis.Number(object.box_cost_val) - : undefined, - bobinCostVal: isSet(object.bobinCostVal) - ? globalThis.Number(object.bobinCostVal) - : isSet(object.bobin_cost_val) - ? globalThis.Number(object.bobin_cost_val) - : undefined, - bbnReuseVal: isSet(object.bbnReuseVal) - ? globalThis.Number(object.bbnReuseVal) - : isSet(object.bbn_reuse_val) - ? globalThis.Number(object.bbn_reuse_val) - : undefined, - boxReuseVal: isSet(object.boxReuseVal) - ? globalThis.Number(object.boxReuseVal) - : isSet(object.box_reuse_val) - ? globalThis.Number(object.box_reuse_val) - : undefined, + reason: isSet(object.reason) ? globalThis.String(object.reason) : "", }; }, - toJSON(message: CreateBoxBobbinCostRequest): unknown { - const obj: any = {}; - if (message.bbcCode !== "") { - obj.bbcCode = message.bbcCode; - } - if (message.bbcName !== "") { - obj.bbcName = message.bbcName; - } - if (message.bbcType !== "") { - obj.bbcType = message.bbcType; - } - if (message.noOfBob !== 0) { - obj.noOfBob = Math.round(message.noOfBob); - } - if (message.notes !== "") { - obj.notes = message.notes; - } - if (message.bbnReuse !== undefined) { - obj.bbnReuse = message.bbnReuse; - } - if (message.boxReuse !== undefined) { - obj.boxReuse = message.boxReuse; - } - if (message.boxCost !== undefined) { - obj.boxCost = message.boxCost; - } - if (message.bobinCost !== undefined) { - obj.bobinCost = message.bobinCost; - } - if (message.boxCostVal !== undefined) { - obj.boxCostVal = message.boxCostVal; - } - if (message.bobinCostVal !== undefined) { - obj.bobinCostVal = message.bobinCostVal; - } - if (message.bbnReuseVal !== undefined) { - obj.bbnReuseVal = message.bbnReuseVal; + toJSON(message: UnApproveMBHeadRequest): unknown { + const obj: any = {}; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } - if (message.boxReuseVal !== undefined) { - obj.boxReuseVal = message.boxReuseVal; + if (message.reason !== "") { + obj.reason = message.reason; } return obj; }, - create(base?: DeepPartial): CreateBoxBobbinCostRequest { - return CreateBoxBobbinCostRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): UnApproveMBHeadRequest { + return UnApproveMBHeadRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateBoxBobbinCostRequest { - const message = createBaseCreateBoxBobbinCostRequest(); - message.bbcCode = object.bbcCode ?? ""; - message.bbcName = object.bbcName ?? ""; - message.bbcType = object.bbcType ?? ""; - message.noOfBob = object.noOfBob ?? 0; - message.notes = object.notes ?? ""; - message.bbnReuse = object.bbnReuse ?? undefined; - message.boxReuse = object.boxReuse ?? undefined; - message.boxCost = object.boxCost ?? undefined; - message.bobinCost = object.bobinCost ?? undefined; - message.boxCostVal = object.boxCostVal ?? undefined; - message.bobinCostVal = object.bobinCostVal ?? undefined; - message.bbnReuseVal = object.bbnReuseVal ?? undefined; - message.boxReuseVal = object.boxReuseVal ?? undefined; + fromPartial(object: DeepPartial): UnApproveMBHeadRequest { + const message = createBaseUnApproveMBHeadRequest(); + message.mbhId = object.mbhId ?? ""; + message.reason = object.reason ?? ""; return message; }, }; -function createBaseCreateBoxBobbinCostResponse(): CreateBoxBobbinCostResponse { +function createBaseUnApproveMBHeadResponse(): UnApproveMBHeadResponse { return { base: undefined, data: undefined }; } -export const CreateBoxBobbinCostResponse: MessageFns = { - encode(message: CreateBoxBobbinCostResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const UnApproveMBHeadResponse: MessageFns = { + encode(message: UnApproveMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } if (message.data !== undefined) { - BoxBobbinCost.encode(message.data, writer.uint32(18).fork()).join(); + MBHead.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateBoxBobbinCostResponse { + decode(input: BinaryReader | Uint8Array, length?: number): UnApproveMBHeadResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateBoxBobbinCostResponse(); + const message = createBaseUnApproveMBHeadResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6155,7 +16366,7 @@ export const CreateBoxBobbinCostResponse: MessageFns): CreateBoxBobbinCostResponse { - return CreateBoxBobbinCostResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): UnApproveMBHeadResponse { + return UnApproveMBHeadResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateBoxBobbinCostResponse { - const message = createBaseCreateBoxBobbinCostResponse(); + fromPartial(object: DeepPartial): UnApproveMBHeadResponse { + const message = createBaseUnApproveMBHeadResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? BoxBobbinCost.fromPartial(object.data) - : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; return message; }, }; -function createBaseGetBoxBobbinCostRequest(): GetBoxBobbinCostRequest { - return { bbcId: "" }; +function createBaseRevokeMBHeadRequest(): RevokeMBHeadRequest { + return { mbhId: "", reason: "" }; } -export const GetBoxBobbinCostRequest: MessageFns = { - encode(message: GetBoxBobbinCostRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.bbcId !== "") { - writer.uint32(10).string(message.bbcId); +export const RevokeMBHeadRequest: MessageFns = { + encode(message: RevokeMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); + } + if (message.reason !== "") { + writer.uint32(18).string(message.reason); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetBoxBobbinCostRequest { + decode(input: BinaryReader | Uint8Array, length?: number): RevokeMBHeadRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetBoxBobbinCostRequest(); + const message = createBaseRevokeMBHeadRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6224,7 +16436,15 @@ export const GetBoxBobbinCostRequest: MessageFns = { break; } - message.bbcId = reader.string(); + message.mbhId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.reason = reader.string(); continue; } } @@ -6236,53 +16456,58 @@ export const GetBoxBobbinCostRequest: MessageFns = { return message; }, - fromJSON(object: any): GetBoxBobbinCostRequest { + fromJSON(object: any): RevokeMBHeadRequest { return { - bbcId: isSet(object.bbcId) - ? globalThis.String(object.bbcId) - : isSet(object.bbc_id) - ? globalThis.String(object.bbc_id) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) : "", + reason: isSet(object.reason) ? globalThis.String(object.reason) : "", }; }, - toJSON(message: GetBoxBobbinCostRequest): unknown { + toJSON(message: RevokeMBHeadRequest): unknown { const obj: any = {}; - if (message.bbcId !== "") { - obj.bbcId = message.bbcId; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; + } + if (message.reason !== "") { + obj.reason = message.reason; } return obj; }, - create(base?: DeepPartial): GetBoxBobbinCostRequest { - return GetBoxBobbinCostRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): RevokeMBHeadRequest { + return RevokeMBHeadRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetBoxBobbinCostRequest { - const message = createBaseGetBoxBobbinCostRequest(); - message.bbcId = object.bbcId ?? ""; + fromPartial(object: DeepPartial): RevokeMBHeadRequest { + const message = createBaseRevokeMBHeadRequest(); + message.mbhId = object.mbhId ?? ""; + message.reason = object.reason ?? ""; return message; }, }; -function createBaseGetBoxBobbinCostResponse(): GetBoxBobbinCostResponse { +function createBaseRevokeMBHeadResponse(): RevokeMBHeadResponse { return { base: undefined, data: undefined }; } -export const GetBoxBobbinCostResponse: MessageFns = { - encode(message: GetBoxBobbinCostResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const RevokeMBHeadResponse: MessageFns = { + encode(message: RevokeMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } if (message.data !== undefined) { - BoxBobbinCost.encode(message.data, writer.uint32(18).fork()).join(); + MBHead.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetBoxBobbinCostResponse { + decode(input: BinaryReader | Uint8Array, length?: number): RevokeMBHeadResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetBoxBobbinCostResponse(); + const message = createBaseRevokeMBHeadResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6299,7 +16524,7 @@ export const GetBoxBobbinCostResponse: MessageFns = { break; } - message.data = BoxBobbinCost.decode(reader, reader.uint32()); + message.data = MBHead.decode(reader, reader.uint32()); continue; } } @@ -6311,109 +16536,111 @@ export const GetBoxBobbinCostResponse: MessageFns = { return message; }, - fromJSON(object: any): GetBoxBobbinCostResponse { + fromJSON(object: any): RevokeMBHeadResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? BoxBobbinCost.fromJSON(object.data) : undefined, + data: isSet(object.data) ? MBHead.fromJSON(object.data) : undefined, }; }, - toJSON(message: GetBoxBobbinCostResponse): unknown { + toJSON(message: RevokeMBHeadResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data !== undefined) { - obj.data = BoxBobbinCost.toJSON(message.data); + obj.data = MBHead.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): GetBoxBobbinCostResponse { - return GetBoxBobbinCostResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): RevokeMBHeadResponse { + return RevokeMBHeadResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetBoxBobbinCostResponse { - const message = createBaseGetBoxBobbinCostResponse(); + fromPartial(object: DeepPartial): RevokeMBHeadResponse { + const message = createBaseRevokeMBHeadResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? BoxBobbinCost.fromPartial(object.data) - : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; return message; }, }; -function createBaseUpdateBoxBobbinCostRequest(): UpdateBoxBobbinCostRequest { +function createBaseMBSpin(): MBSpin { return { - bbcId: "", - bbcName: undefined, - bbcType: undefined, - noOfBob: undefined, - notes: undefined, - isActive: undefined, - bbnReuse: undefined, - boxReuse: undefined, - boxCost: undefined, - bobinCost: undefined, - boxCostVal: undefined, - bobinCostVal: undefined, - bbnReuseVal: undefined, - boxReuseVal: undefined, + mbsId: "", + mbsOracleSysId: "", + mbsMbhId: "", + mbsMgtName: "", + mbsDenier: undefined, + mbsFilament: undefined, + mbsDozing: undefined, + mbsMbCosting: "", + mbsIsActive: false, + mbsCc: undefined, + mbsCostRateMkt: undefined, + mbsStatus: undefined, + mbsLdrPrsn: undefined, + mbsFinalProduct: undefined, + audit: undefined, }; } -export const UpdateBoxBobbinCostRequest: MessageFns = { - encode(message: UpdateBoxBobbinCostRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.bbcId !== "") { - writer.uint32(10).string(message.bbcId); +export const MBSpin: MessageFns = { + encode(message: MBSpin, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbsId !== "") { + writer.uint32(10).string(message.mbsId); } - if (message.bbcName !== undefined) { - writer.uint32(18).string(message.bbcName); + if (message.mbsOracleSysId !== "") { + writer.uint32(18).string(message.mbsOracleSysId); } - if (message.bbcType !== undefined) { - writer.uint32(26).string(message.bbcType); + if (message.mbsMbhId !== "") { + writer.uint32(26).string(message.mbsMbhId); } - if (message.noOfBob !== undefined) { - writer.uint32(32).int32(message.noOfBob); + if (message.mbsMgtName !== "") { + writer.uint32(34).string(message.mbsMgtName); } - if (message.notes !== undefined) { - writer.uint32(42).string(message.notes); + if (message.mbsDenier !== undefined) { + writer.uint32(41).double(message.mbsDenier); } - if (message.isActive !== undefined) { - writer.uint32(48).bool(message.isActive); + if (message.mbsFilament !== undefined) { + writer.uint32(48).int32(message.mbsFilament); } - if (message.bbnReuse !== undefined) { - writer.uint32(57).double(message.bbnReuse); + if (message.mbsDozing !== undefined) { + writer.uint32(57).double(message.mbsDozing); } - if (message.boxReuse !== undefined) { - writer.uint32(65).double(message.boxReuse); + if (message.mbsMbCosting !== "") { + writer.uint32(66).string(message.mbsMbCosting); } - if (message.boxCost !== undefined) { - writer.uint32(73).double(message.boxCost); + if (message.mbsIsActive !== false) { + writer.uint32(72).bool(message.mbsIsActive); } - if (message.bobinCost !== undefined) { - writer.uint32(81).double(message.bobinCost); + if (message.mbsCc !== undefined) { + writer.uint32(82).string(message.mbsCc); } - if (message.boxCostVal !== undefined) { - writer.uint32(89).double(message.boxCostVal); + if (message.mbsCostRateMkt !== undefined) { + writer.uint32(89).double(message.mbsCostRateMkt); } - if (message.bobinCostVal !== undefined) { - writer.uint32(97).double(message.bobinCostVal); + if (message.mbsStatus !== undefined) { + writer.uint32(98).string(message.mbsStatus); } - if (message.bbnReuseVal !== undefined) { - writer.uint32(105).double(message.bbnReuseVal); + if (message.mbsLdrPrsn !== undefined) { + writer.uint32(105).double(message.mbsLdrPrsn); } - if (message.boxReuseVal !== undefined) { - writer.uint32(113).double(message.boxReuseVal); + if (message.mbsFinalProduct !== undefined) { + writer.uint32(114).string(message.mbsFinalProduct); + } + if (message.audit !== undefined) { + AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateBoxBobbinCostRequest { + decode(input: BinaryReader | Uint8Array, length?: number): MBSpin { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateBoxBobbinCostRequest(); + const message = createBaseMBSpin(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6422,7 +16649,7 @@ export const UpdateBoxBobbinCostRequest: MessageFns break; } - message.bbcId = reader.string(); + message.mbsId = reader.string(); continue; } case 2: { @@ -6430,7 +16657,7 @@ export const UpdateBoxBobbinCostRequest: MessageFns break; } - message.bbcName = reader.string(); + message.mbsOracleSysId = reader.string(); continue; } case 3: { @@ -6438,23 +16665,23 @@ export const UpdateBoxBobbinCostRequest: MessageFns break; } - message.bbcType = reader.string(); + message.mbsMbhId = reader.string(); continue; } case 4: { - if (tag !== 32) { + if (tag !== 34) { break; } - message.noOfBob = reader.int32(); + message.mbsMgtName = reader.string(); continue; } case 5: { - if (tag !== 42) { + if (tag !== 41) { break; } - message.notes = reader.string(); + message.mbsDenier = reader.double(); continue; } case 6: { @@ -6462,7 +16689,7 @@ export const UpdateBoxBobbinCostRequest: MessageFns break; } - message.isActive = reader.bool(); + message.mbsFilament = reader.int32(); continue; } case 7: { @@ -6470,31 +16697,31 @@ export const UpdateBoxBobbinCostRequest: MessageFns break; } - message.bbnReuse = reader.double(); + message.mbsDozing = reader.double(); continue; } case 8: { - if (tag !== 65) { + if (tag !== 66) { break; } - message.boxReuse = reader.double(); + message.mbsMbCosting = reader.string(); continue; } case 9: { - if (tag !== 73) { + if (tag !== 72) { break; } - message.boxCost = reader.double(); + message.mbsIsActive = reader.bool(); continue; } case 10: { - if (tag !== 81) { + if (tag !== 82) { break; } - message.bobinCost = reader.double(); + message.mbsCc = reader.string(); continue; } case 11: { @@ -6502,15 +16729,15 @@ export const UpdateBoxBobbinCostRequest: MessageFns break; } - message.boxCostVal = reader.double(); + message.mbsCostRateMkt = reader.double(); continue; } case 12: { - if (tag !== 97) { + if (tag !== 98) { break; } - message.bobinCostVal = reader.double(); + message.mbsStatus = reader.string(); continue; } case 13: { @@ -6518,15 +16745,23 @@ export const UpdateBoxBobbinCostRequest: MessageFns break; } - message.bbnReuseVal = reader.double(); + message.mbsLdrPrsn = reader.double(); continue; } case 14: { - if (tag !== 113) { + if (tag !== 114) { + break; + } + + message.mbsFinalProduct = reader.string(); + continue; + } + case 16: { + if (tag !== 130) { break; } - message.boxReuseVal = reader.double(); + message.audit = AuditInfo.decode(reader, reader.uint32()); continue; } } @@ -6538,166 +16773,220 @@ export const UpdateBoxBobbinCostRequest: MessageFns return message; }, - fromJSON(object: any): UpdateBoxBobbinCostRequest { + fromJSON(object: any): MBSpin { return { - bbcId: isSet(object.bbcId) - ? globalThis.String(object.bbcId) - : isSet(object.bbc_id) - ? globalThis.String(object.bbc_id) + mbsId: isSet(object.mbsId) + ? globalThis.String(object.mbsId) + : isSet(object.mbs_id) + ? globalThis.String(object.mbs_id) : "", - bbcName: isSet(object.bbcName) - ? globalThis.String(object.bbcName) - : isSet(object.bbc_name) - ? globalThis.String(object.bbc_name) - : undefined, - bbcType: isSet(object.bbcType) - ? globalThis.String(object.bbcType) - : isSet(object.bbc_type) - ? globalThis.String(object.bbc_type) - : undefined, - noOfBob: isSet(object.noOfBob) - ? globalThis.Number(object.noOfBob) - : isSet(object.no_of_bob) - ? globalThis.Number(object.no_of_bob) - : undefined, - notes: isSet(object.notes) ? globalThis.String(object.notes) : undefined, - isActive: isSet(object.isActive) - ? globalThis.Boolean(object.isActive) - : isSet(object.is_active) - ? globalThis.Boolean(object.is_active) - : undefined, - bbnReuse: isSet(object.bbnReuse) - ? globalThis.Number(object.bbnReuse) - : isSet(object.bbn_reuse) - ? globalThis.Number(object.bbn_reuse) + mbsOracleSysId: isSet(object.mbsOracleSysId) + ? globalThis.String(object.mbsOracleSysId) + : isSet(object.mbs_oracle_sys_id) + ? globalThis.String(object.mbs_oracle_sys_id) + : "", + mbsMbhId: isSet(object.mbsMbhId) + ? globalThis.String(object.mbsMbhId) + : isSet(object.mbs_mbh_id) + ? globalThis.String(object.mbs_mbh_id) + : "", + mbsMgtName: isSet(object.mbsMgtName) + ? globalThis.String(object.mbsMgtName) + : isSet(object.mbs_mgt_name) + ? globalThis.String(object.mbs_mgt_name) + : "", + mbsDenier: isSet(object.mbsDenier) + ? globalThis.Number(object.mbsDenier) + : isSet(object.mbs_denier) + ? globalThis.Number(object.mbs_denier) : undefined, - boxReuse: isSet(object.boxReuse) - ? globalThis.Number(object.boxReuse) - : isSet(object.box_reuse) - ? globalThis.Number(object.box_reuse) + mbsFilament: isSet(object.mbsFilament) + ? globalThis.Number(object.mbsFilament) + : isSet(object.mbs_filament) + ? globalThis.Number(object.mbs_filament) : undefined, - boxCost: isSet(object.boxCost) - ? globalThis.Number(object.boxCost) - : isSet(object.box_cost) - ? globalThis.Number(object.box_cost) + mbsDozing: isSet(object.mbsDozing) + ? globalThis.Number(object.mbsDozing) + : isSet(object.mbs_dozing) + ? globalThis.Number(object.mbs_dozing) : undefined, - bobinCost: isSet(object.bobinCost) - ? globalThis.Number(object.bobinCost) - : isSet(object.bobin_cost) - ? globalThis.Number(object.bobin_cost) + mbsMbCosting: isSet(object.mbsMbCosting) + ? globalThis.String(object.mbsMbCosting) + : isSet(object.mbs_mb_costing) + ? globalThis.String(object.mbs_mb_costing) + : "", + mbsIsActive: isSet(object.mbsIsActive) + ? globalThis.Boolean(object.mbsIsActive) + : isSet(object.mbs_is_active) + ? globalThis.Boolean(object.mbs_is_active) + : false, + mbsCc: isSet(object.mbsCc) + ? globalThis.String(object.mbsCc) + : isSet(object.mbs_cc) + ? globalThis.String(object.mbs_cc) : undefined, - boxCostVal: isSet(object.boxCostVal) - ? globalThis.Number(object.boxCostVal) - : isSet(object.box_cost_val) - ? globalThis.Number(object.box_cost_val) + mbsCostRateMkt: isSet(object.mbsCostRateMkt) + ? globalThis.Number(object.mbsCostRateMkt) + : isSet(object.mbs_cost_rate_mkt) + ? globalThis.Number(object.mbs_cost_rate_mkt) : undefined, - bobinCostVal: isSet(object.bobinCostVal) - ? globalThis.Number(object.bobinCostVal) - : isSet(object.bobin_cost_val) - ? globalThis.Number(object.bobin_cost_val) + mbsStatus: isSet(object.mbsStatus) + ? globalThis.String(object.mbsStatus) + : isSet(object.mbs_status) + ? globalThis.String(object.mbs_status) : undefined, - bbnReuseVal: isSet(object.bbnReuseVal) - ? globalThis.Number(object.bbnReuseVal) - : isSet(object.bbn_reuse_val) - ? globalThis.Number(object.bbn_reuse_val) + mbsLdrPrsn: isSet(object.mbsLdrPrsn) + ? globalThis.Number(object.mbsLdrPrsn) + : isSet(object.mbs_ldr_prsn) + ? globalThis.Number(object.mbs_ldr_prsn) : undefined, - boxReuseVal: isSet(object.boxReuseVal) - ? globalThis.Number(object.boxReuseVal) - : isSet(object.box_reuse_val) - ? globalThis.Number(object.box_reuse_val) + mbsFinalProduct: isSet(object.mbsFinalProduct) + ? globalThis.String(object.mbsFinalProduct) + : isSet(object.mbs_final_product) + ? globalThis.String(object.mbs_final_product) : undefined, + audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, }; }, - toJSON(message: UpdateBoxBobbinCostRequest): unknown { + toJSON(message: MBSpin): unknown { const obj: any = {}; - if (message.bbcId !== "") { - obj.bbcId = message.bbcId; + if (message.mbsId !== "") { + obj.mbsId = message.mbsId; } - if (message.bbcName !== undefined) { - obj.bbcName = message.bbcName; + if (message.mbsOracleSysId !== "") { + obj.mbsOracleSysId = message.mbsOracleSysId; } - if (message.bbcType !== undefined) { - obj.bbcType = message.bbcType; + if (message.mbsMbhId !== "") { + obj.mbsMbhId = message.mbsMbhId; } - if (message.noOfBob !== undefined) { - obj.noOfBob = Math.round(message.noOfBob); + if (message.mbsMgtName !== "") { + obj.mbsMgtName = message.mbsMgtName; } - if (message.notes !== undefined) { - obj.notes = message.notes; + if (message.mbsDenier !== undefined) { + obj.mbsDenier = message.mbsDenier; } - if (message.isActive !== undefined) { - obj.isActive = message.isActive; + if (message.mbsFilament !== undefined) { + obj.mbsFilament = Math.round(message.mbsFilament); } - if (message.bbnReuse !== undefined) { - obj.bbnReuse = message.bbnReuse; + if (message.mbsDozing !== undefined) { + obj.mbsDozing = message.mbsDozing; } - if (message.boxReuse !== undefined) { - obj.boxReuse = message.boxReuse; + if (message.mbsMbCosting !== "") { + obj.mbsMbCosting = message.mbsMbCosting; } - if (message.boxCost !== undefined) { - obj.boxCost = message.boxCost; + if (message.mbsIsActive !== false) { + obj.mbsIsActive = message.mbsIsActive; } - if (message.bobinCost !== undefined) { - obj.bobinCost = message.bobinCost; + if (message.mbsCc !== undefined) { + obj.mbsCc = message.mbsCc; } - if (message.boxCostVal !== undefined) { - obj.boxCostVal = message.boxCostVal; + if (message.mbsCostRateMkt !== undefined) { + obj.mbsCostRateMkt = message.mbsCostRateMkt; } - if (message.bobinCostVal !== undefined) { - obj.bobinCostVal = message.bobinCostVal; + if (message.mbsStatus !== undefined) { + obj.mbsStatus = message.mbsStatus; } - if (message.bbnReuseVal !== undefined) { - obj.bbnReuseVal = message.bbnReuseVal; + if (message.mbsLdrPrsn !== undefined) { + obj.mbsLdrPrsn = message.mbsLdrPrsn; } - if (message.boxReuseVal !== undefined) { - obj.boxReuseVal = message.boxReuseVal; + if (message.mbsFinalProduct !== undefined) { + obj.mbsFinalProduct = message.mbsFinalProduct; + } + if (message.audit !== undefined) { + obj.audit = AuditInfo.toJSON(message.audit); } return obj; }, - create(base?: DeepPartial): UpdateBoxBobbinCostRequest { - return UpdateBoxBobbinCostRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): MBSpin { + return MBSpin.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateBoxBobbinCostRequest { - const message = createBaseUpdateBoxBobbinCostRequest(); - message.bbcId = object.bbcId ?? ""; - message.bbcName = object.bbcName ?? undefined; - message.bbcType = object.bbcType ?? undefined; - message.noOfBob = object.noOfBob ?? undefined; - message.notes = object.notes ?? undefined; - message.isActive = object.isActive ?? undefined; - message.bbnReuse = object.bbnReuse ?? undefined; - message.boxReuse = object.boxReuse ?? undefined; - message.boxCost = object.boxCost ?? undefined; - message.bobinCost = object.bobinCost ?? undefined; - message.boxCostVal = object.boxCostVal ?? undefined; - message.bobinCostVal = object.bobinCostVal ?? undefined; - message.bbnReuseVal = object.bbnReuseVal ?? undefined; - message.boxReuseVal = object.boxReuseVal ?? undefined; + fromPartial(object: DeepPartial): MBSpin { + const message = createBaseMBSpin(); + message.mbsId = object.mbsId ?? ""; + message.mbsOracleSysId = object.mbsOracleSysId ?? ""; + message.mbsMbhId = object.mbsMbhId ?? ""; + message.mbsMgtName = object.mbsMgtName ?? ""; + message.mbsDenier = object.mbsDenier ?? undefined; + message.mbsFilament = object.mbsFilament ?? undefined; + message.mbsDozing = object.mbsDozing ?? undefined; + message.mbsMbCosting = object.mbsMbCosting ?? ""; + message.mbsIsActive = object.mbsIsActive ?? false; + message.mbsCc = object.mbsCc ?? undefined; + message.mbsCostRateMkt = object.mbsCostRateMkt ?? undefined; + message.mbsStatus = object.mbsStatus ?? undefined; + message.mbsLdrPrsn = object.mbsLdrPrsn ?? undefined; + message.mbsFinalProduct = object.mbsFinalProduct ?? undefined; + message.audit = (object.audit !== undefined && object.audit !== null) + ? AuditInfo.fromPartial(object.audit) + : undefined; return message; }, }; -function createBaseUpdateBoxBobbinCostResponse(): UpdateBoxBobbinCostResponse { - return { base: undefined, data: undefined }; +function createBaseCreateMBSpinRequest(): CreateMBSpinRequest { + return { + mbhId: "", + mbsMgtName: "", + mbsOracleSysId: undefined, + mbsDenier: undefined, + mbsFilament: undefined, + mbsDozing: undefined, + mbsMbCosting: undefined, + mbsCc: undefined, + mbsCostRateMkt: undefined, + mbsStatus: undefined, + mbsLdrPrsn: undefined, + mbsFinalProduct: undefined, + }; } -export const UpdateBoxBobbinCostResponse: MessageFns = { - encode(message: UpdateBoxBobbinCostResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); +export const CreateMBSpinRequest: MessageFns = { + encode(message: CreateMBSpinRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); + } + if (message.mbsMgtName !== "") { + writer.uint32(18).string(message.mbsMgtName); + } + if (message.mbsOracleSysId !== undefined) { + writer.uint32(26).string(message.mbsOracleSysId); + } + if (message.mbsDenier !== undefined) { + writer.uint32(33).double(message.mbsDenier); } - if (message.data !== undefined) { - BoxBobbinCost.encode(message.data, writer.uint32(18).fork()).join(); + if (message.mbsFilament !== undefined) { + writer.uint32(40).int32(message.mbsFilament); + } + if (message.mbsDozing !== undefined) { + writer.uint32(49).double(message.mbsDozing); + } + if (message.mbsMbCosting !== undefined) { + writer.uint32(58).string(message.mbsMbCosting); + } + if (message.mbsCc !== undefined) { + writer.uint32(66).string(message.mbsCc); + } + if (message.mbsCostRateMkt !== undefined) { + writer.uint32(73).double(message.mbsCostRateMkt); + } + if (message.mbsStatus !== undefined) { + writer.uint32(82).string(message.mbsStatus); + } + if (message.mbsLdrPrsn !== undefined) { + writer.uint32(89).double(message.mbsLdrPrsn); + } + if (message.mbsFinalProduct !== undefined) { + writer.uint32(98).string(message.mbsFinalProduct); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateBoxBobbinCostResponse { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMBSpinRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateBoxBobbinCostResponse(); + const message = createBaseCreateMBSpinRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6706,7 +16995,7 @@ export const UpdateBoxBobbinCostResponse: MessageFns): UpdateBoxBobbinCostResponse { - return UpdateBoxBobbinCostResponse.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): UpdateBoxBobbinCostResponse { - const message = createBaseUpdateBoxBobbinCostResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? BoxBobbinCost.fromPartial(object.data) - : undefined; - return message; - }, -}; - -function createBaseDeleteBoxBobbinCostRequest(): DeleteBoxBobbinCostRequest { - return { bbcId: "" }; -} - -export const DeleteBoxBobbinCostRequest: MessageFns = { - encode(message: DeleteBoxBobbinCostRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.bbcId !== "") { - writer.uint32(10).string(message.bbcId); + if (message.mbsOracleSysId !== undefined) { + obj.mbsOracleSysId = message.mbsOracleSysId; } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): DeleteBoxBobbinCostRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteBoxBobbinCostRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.bbcId = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + if (message.mbsDenier !== undefined) { + obj.mbsDenier = message.mbsDenier; + } + if (message.mbsFilament !== undefined) { + obj.mbsFilament = Math.round(message.mbsFilament); + } + if (message.mbsDozing !== undefined) { + obj.mbsDozing = message.mbsDozing; + } + if (message.mbsMbCosting !== undefined) { + obj.mbsMbCosting = message.mbsMbCosting; + } + if (message.mbsCc !== undefined) { + obj.mbsCc = message.mbsCc; + } + if (message.mbsCostRateMkt !== undefined) { + obj.mbsCostRateMkt = message.mbsCostRateMkt; } - return message; - }, - - fromJSON(object: any): DeleteBoxBobbinCostRequest { - return { - bbcId: isSet(object.bbcId) - ? globalThis.String(object.bbcId) - : isSet(object.bbc_id) - ? globalThis.String(object.bbc_id) - : "", - }; - }, - - toJSON(message: DeleteBoxBobbinCostRequest): unknown { - const obj: any = {}; - if (message.bbcId !== "") { - obj.bbcId = message.bbcId; + if (message.mbsStatus !== undefined) { + obj.mbsStatus = message.mbsStatus; + } + if (message.mbsLdrPrsn !== undefined) { + obj.mbsLdrPrsn = message.mbsLdrPrsn; + } + if (message.mbsFinalProduct !== undefined) { + obj.mbsFinalProduct = message.mbsFinalProduct; } return obj; }, - create(base?: DeepPartial): DeleteBoxBobbinCostRequest { - return DeleteBoxBobbinCostRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMBSpinRequest { + return CreateMBSpinRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteBoxBobbinCostRequest { - const message = createBaseDeleteBoxBobbinCostRequest(); - message.bbcId = object.bbcId ?? ""; + fromPartial(object: DeepPartial): CreateMBSpinRequest { + const message = createBaseCreateMBSpinRequest(); + message.mbhId = object.mbhId ?? ""; + message.mbsMgtName = object.mbsMgtName ?? ""; + message.mbsOracleSysId = object.mbsOracleSysId ?? undefined; + message.mbsDenier = object.mbsDenier ?? undefined; + message.mbsFilament = object.mbsFilament ?? undefined; + message.mbsDozing = object.mbsDozing ?? undefined; + message.mbsMbCosting = object.mbsMbCosting ?? undefined; + message.mbsCc = object.mbsCc ?? undefined; + message.mbsCostRateMkt = object.mbsCostRateMkt ?? undefined; + message.mbsStatus = object.mbsStatus ?? undefined; + message.mbsLdrPrsn = object.mbsLdrPrsn ?? undefined; + message.mbsFinalProduct = object.mbsFinalProduct ?? undefined; return message; }, }; -function createBaseDeleteBoxBobbinCostResponse(): DeleteBoxBobbinCostResponse { - return { base: undefined }; +function createBaseCreateMBSpinResponse(): CreateMBSpinResponse { + return { base: undefined, data: undefined }; } -export const DeleteBoxBobbinCostResponse: MessageFns = { - encode(message: DeleteBoxBobbinCostResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const CreateMBSpinResponse: MessageFns = { + encode(message: CreateMBSpinResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } + if (message.data !== undefined) { + MBSpin.encode(message.data, writer.uint32(18).fork()).join(); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteBoxBobbinCostResponse { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMBSpinResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteBoxBobbinCostResponse(); + const message = createBaseCreateMBSpinResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -6850,6 +17252,14 @@ export const DeleteBoxBobbinCostResponse: MessageFns): DeleteBoxBobbinCostResponse { - return DeleteBoxBobbinCostResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMBSpinResponse { + return CreateMBSpinResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteBoxBobbinCostResponse { - const message = createBaseDeleteBoxBobbinCostResponse(); + fromPartial(object: DeepPartial): CreateMBSpinResponse { + const message = createBaseCreateMBSpinResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBSpin.fromPartial(object.data) : undefined; return message; }, }; -function createBaseListBoxBobbinCostsRequest(): ListBoxBobbinCostsRequest { - return { page: 0, pageSize: 0, search: "", bbcType: "", activeFilter: 0, sortBy: "", sortOrder: "" }; +function createBaseGetMBSpinRequest(): GetMBSpinRequest { + return { mbhId: "", mbsId: "" }; } -export const ListBoxBobbinCostsRequest: MessageFns = { - encode(message: ListBoxBobbinCostsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.page !== 0) { - writer.uint32(8).int32(message.page); - } - if (message.pageSize !== 0) { - writer.uint32(16).int32(message.pageSize); - } - if (message.search !== "") { - writer.uint32(26).string(message.search); - } - if (message.bbcType !== "") { - writer.uint32(34).string(message.bbcType); - } - if (message.activeFilter !== 0) { - writer.uint32(40).int32(message.activeFilter); - } - if (message.sortBy !== "") { - writer.uint32(50).string(message.sortBy); +export const GetMBSpinRequest: MessageFns = { + encode(message: GetMBSpinRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } - if (message.sortOrder !== "") { - writer.uint32(58).string(message.sortOrder); + if (message.mbsId !== "") { + writer.uint32(18).string(message.mbsId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListBoxBobbinCostsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): GetMBSpinRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListBoxBobbinCostsRequest(); + const message = createBaseGetMBSpinRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 8) { + if (tag !== 10) { break; } - message.page = reader.int32(); + message.mbhId = reader.string(); continue; } case 2: { - if (tag !== 16) { - break; - } - - message.pageSize = reader.int32(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.search = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.bbcType = reader.string(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.activeFilter = reader.int32() as any; - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.sortBy = reader.string(); - continue; - } - case 7: { - if (tag !== 58) { + if (tag !== 18) { break; } - message.sortOrder = reader.string(); + message.mbsId = reader.string(); continue; } } @@ -6985,102 +17347,62 @@ export const ListBoxBobbinCostsRequest: MessageFns = return message; }, - fromJSON(object: any): ListBoxBobbinCostsRequest { + fromJSON(object: any): GetMBSpinRequest { return { - page: isSet(object.page) ? globalThis.Number(object.page) : 0, - pageSize: isSet(object.pageSize) - ? globalThis.Number(object.pageSize) - : isSet(object.page_size) - ? globalThis.Number(object.page_size) - : 0, - search: isSet(object.search) ? globalThis.String(object.search) : "", - bbcType: isSet(object.bbcType) - ? globalThis.String(object.bbcType) - : isSet(object.bbc_type) - ? globalThis.String(object.bbc_type) - : "", - activeFilter: isSet(object.activeFilter) - ? activeFilterFromJSON(object.activeFilter) - : isSet(object.active_filter) - ? activeFilterFromJSON(object.active_filter) - : 0, - sortBy: isSet(object.sortBy) - ? globalThis.String(object.sortBy) - : isSet(object.sort_by) - ? globalThis.String(object.sort_by) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) : "", - sortOrder: isSet(object.sortOrder) - ? globalThis.String(object.sortOrder) - : isSet(object.sort_order) - ? globalThis.String(object.sort_order) + mbsId: isSet(object.mbsId) + ? globalThis.String(object.mbsId) + : isSet(object.mbs_id) + ? globalThis.String(object.mbs_id) : "", }; }, - toJSON(message: ListBoxBobbinCostsRequest): unknown { + toJSON(message: GetMBSpinRequest): unknown { const obj: any = {}; - if (message.page !== 0) { - obj.page = Math.round(message.page); - } - if (message.pageSize !== 0) { - obj.pageSize = Math.round(message.pageSize); - } - if (message.search !== "") { - obj.search = message.search; - } - if (message.bbcType !== "") { - obj.bbcType = message.bbcType; - } - if (message.activeFilter !== 0) { - obj.activeFilter = activeFilterToJSON(message.activeFilter); - } - if (message.sortBy !== "") { - obj.sortBy = message.sortBy; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } - if (message.sortOrder !== "") { - obj.sortOrder = message.sortOrder; + if (message.mbsId !== "") { + obj.mbsId = message.mbsId; } return obj; }, - create(base?: DeepPartial): ListBoxBobbinCostsRequest { - return ListBoxBobbinCostsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): GetMBSpinRequest { + return GetMBSpinRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListBoxBobbinCostsRequest { - const message = createBaseListBoxBobbinCostsRequest(); - message.page = object.page ?? 0; - message.pageSize = object.pageSize ?? 0; - message.search = object.search ?? ""; - message.bbcType = object.bbcType ?? ""; - message.activeFilter = object.activeFilter ?? 0; - message.sortBy = object.sortBy ?? ""; - message.sortOrder = object.sortOrder ?? ""; + fromPartial(object: DeepPartial): GetMBSpinRequest { + const message = createBaseGetMBSpinRequest(); + message.mbhId = object.mbhId ?? ""; + message.mbsId = object.mbsId ?? ""; return message; }, }; -function createBaseListBoxBobbinCostsResponse(): ListBoxBobbinCostsResponse { - return { base: undefined, data: [], pagination: undefined }; +function createBaseGetMBSpinResponse(): GetMBSpinResponse { + return { base: undefined, data: undefined }; } -export const ListBoxBobbinCostsResponse: MessageFns = { - encode(message: ListBoxBobbinCostsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const GetMBSpinResponse: MessageFns = { + encode(message: GetMBSpinResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - for (const v of message.data) { - BoxBobbinCost.encode(v!, writer.uint32(18).fork()).join(); - } - if (message.pagination !== undefined) { - PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); + if (message.data !== undefined) { + MBSpin.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListBoxBobbinCostsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): GetMBSpinResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListBoxBobbinCostsResponse(); + const message = createBaseGetMBSpinResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -7097,15 +17419,7 @@ export const ListBoxBobbinCostsResponse: MessageFns break; } - message.data.push(BoxBobbinCost.decode(reader, reader.uint32())); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.pagination = PaginationResponse.decode(reader, reader.uint32()); + message.data = MBSpin.decode(reader, reader.uint32()); continue; } } @@ -7117,82 +17431,103 @@ export const ListBoxBobbinCostsResponse: MessageFns return message; }, - fromJSON(object: any): ListBoxBobbinCostsResponse { + fromJSON(object: any): GetMBSpinResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => BoxBobbinCost.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, + data: isSet(object.data) ? MBSpin.fromJSON(object.data) : undefined, }; }, - toJSON(message: ListBoxBobbinCostsResponse): unknown { + toJSON(message: GetMBSpinResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data?.length) { - obj.data = message.data.map((e) => BoxBobbinCost.toJSON(e)); - } - if (message.pagination !== undefined) { - obj.pagination = PaginationResponse.toJSON(message.pagination); + if (message.data !== undefined) { + obj.data = MBSpin.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): ListBoxBobbinCostsResponse { - return ListBoxBobbinCostsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): GetMBSpinResponse { + return GetMBSpinResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListBoxBobbinCostsResponse { - const message = createBaseListBoxBobbinCostsResponse(); + fromPartial(object: DeepPartial): GetMBSpinResponse { + const message = createBaseGetMBSpinResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = object.data?.map((e) => BoxBobbinCost.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PaginationResponse.fromPartial(object.pagination) - : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBSpin.fromPartial(object.data) : undefined; return message; }, }; -function createBaseCreateBoxBobbinCostRateRequest(): CreateBoxBobbinCostRateRequest { +function createBaseUpdateMBSpinRequest(): UpdateMBSpinRequest { return { - bbcId: "", - bbcrPeriod: "", - bbcrBobRateMkt: 0, - bbcrBoxRateMkt: 0, - bbcrBobRateVal: undefined, - bbcrBoxRateVal: undefined, + mbhId: "", + mbsId: "", + mbsMgtName: undefined, + mbsDenier: undefined, + mbsFilament: undefined, + mbsDozing: undefined, + mbsMbCosting: undefined, + mbsIsActive: undefined, + mbsCc: undefined, + mbsCostRateMkt: undefined, + mbsStatus: undefined, + mbsLdrPrsn: undefined, + mbsFinalProduct: undefined, }; } -export const CreateBoxBobbinCostRateRequest: MessageFns = { - encode(message: CreateBoxBobbinCostRateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.bbcId !== "") { - writer.uint32(10).string(message.bbcId); +export const UpdateMBSpinRequest: MessageFns = { + encode(message: UpdateMBSpinRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } - if (message.bbcrPeriod !== "") { - writer.uint32(18).string(message.bbcrPeriod); + if (message.mbsId !== "") { + writer.uint32(18).string(message.mbsId); } - if (message.bbcrBobRateMkt !== 0) { - writer.uint32(25).double(message.bbcrBobRateMkt); + if (message.mbsMgtName !== undefined) { + writer.uint32(26).string(message.mbsMgtName); } - if (message.bbcrBoxRateMkt !== 0) { - writer.uint32(33).double(message.bbcrBoxRateMkt); + if (message.mbsDenier !== undefined) { + writer.uint32(33).double(message.mbsDenier); } - if (message.bbcrBobRateVal !== undefined) { - writer.uint32(41).double(message.bbcrBobRateVal); + if (message.mbsFilament !== undefined) { + writer.uint32(40).int32(message.mbsFilament); } - if (message.bbcrBoxRateVal !== undefined) { - writer.uint32(49).double(message.bbcrBoxRateVal); + if (message.mbsDozing !== undefined) { + writer.uint32(49).double(message.mbsDozing); + } + if (message.mbsMbCosting !== undefined) { + writer.uint32(58).string(message.mbsMbCosting); + } + if (message.mbsIsActive !== undefined) { + writer.uint32(64).bool(message.mbsIsActive); + } + if (message.mbsCc !== undefined) { + writer.uint32(74).string(message.mbsCc); + } + if (message.mbsCostRateMkt !== undefined) { + writer.uint32(81).double(message.mbsCostRateMkt); + } + if (message.mbsStatus !== undefined) { + writer.uint32(90).string(message.mbsStatus); + } + if (message.mbsLdrPrsn !== undefined) { + writer.uint32(97).double(message.mbsLdrPrsn); + } + if (message.mbsFinalProduct !== undefined) { + writer.uint32(106).string(message.mbsFinalProduct); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateBoxBobbinCostRateRequest { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMBSpinRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateBoxBobbinCostRateRequest(); + const message = createBaseUpdateMBSpinRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -7201,7 +17536,7 @@ export const CreateBoxBobbinCostRateRequest: MessageFns): CreateBoxBobbinCostRateRequest { - return CreateBoxBobbinCostRateRequest.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): CreateBoxBobbinCostRateRequest { - const message = createBaseCreateBoxBobbinCostRateRequest(); - message.bbcId = object.bbcId ?? ""; - message.bbcrPeriod = object.bbcrPeriod ?? ""; - message.bbcrBobRateMkt = object.bbcrBobRateMkt ?? 0; - message.bbcrBoxRateMkt = object.bbcrBoxRateMkt ?? 0; - message.bbcrBobRateVal = object.bbcrBobRateVal ?? undefined; - message.bbcrBoxRateVal = object.bbcrBoxRateVal ?? undefined; - return message; - }, -}; - -function createBaseCreateBoxBobbinCostRateResponse(): CreateBoxBobbinCostRateResponse { - return { base: undefined, data: undefined }; -} - -export const CreateBoxBobbinCostRateResponse: MessageFns = { - encode(message: CreateBoxBobbinCostRateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); - } - if (message.data !== undefined) { - BoxBobbinCostRate.encode(message.data, writer.uint32(18).fork()).join(); - } - return writer; - }, + if (tag !== 26) { + break; + } - decode(input: BinaryReader | Uint8Array, length?: number): CreateBoxBobbinCostRateResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateBoxBobbinCostRateResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { + message.mbsMgtName = reader.string(); + continue; + } + case 4: { + if (tag !== 33) { break; } - message.base = BaseResponse.decode(reader, reader.uint32()); + message.mbsDenier = reader.double(); continue; } - case 2: { - if (tag !== 18) { + case 5: { + if (tag !== 40) { break; } - message.data = BoxBobbinCostRate.decode(reader, reader.uint32()); + message.mbsFilament = reader.int32(); continue; } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, + case 6: { + if (tag !== 49) { + break; + } - fromJSON(object: any): CreateBoxBobbinCostRateResponse { - return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? BoxBobbinCostRate.fromJSON(object.data) : undefined, - }; - }, + message.mbsDozing = reader.double(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } - toJSON(message: CreateBoxBobbinCostRateResponse): unknown { - const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); - } - if (message.data !== undefined) { - obj.data = BoxBobbinCostRate.toJSON(message.data); - } - return obj; - }, + message.mbsMbCosting = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } - create(base?: DeepPartial): CreateBoxBobbinCostRateResponse { - return CreateBoxBobbinCostRateResponse.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): CreateBoxBobbinCostRateResponse { - const message = createBaseCreateBoxBobbinCostRateResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? BoxBobbinCostRate.fromPartial(object.data) - : undefined; - return message; - }, -}; + message.mbsIsActive = reader.bool(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } -function createBaseDeleteBoxBobbinCostRateRequest(): DeleteBoxBobbinCostRateRequest { - return { bbcId: "", bbcrId: "" }; -} + message.mbsCc = reader.string(); + continue; + } + case 10: { + if (tag !== 81) { + break; + } -export const DeleteBoxBobbinCostRateRequest: MessageFns = { - encode(message: DeleteBoxBobbinCostRateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.bbcId !== "") { - writer.uint32(10).string(message.bbcId); - } - if (message.bbcrId !== "") { - writer.uint32(18).string(message.bbcrId); - } - return writer; - }, + message.mbsCostRateMkt = reader.double(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } - decode(input: BinaryReader | Uint8Array, length?: number): DeleteBoxBobbinCostRateRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteBoxBobbinCostRateRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { + message.mbsStatus = reader.string(); + continue; + } + case 12: { + if (tag !== 97) { break; } - message.bbcId = reader.string(); + message.mbsLdrPrsn = reader.double(); continue; } - case 2: { - if (tag !== 18) { + case 13: { + if (tag !== 106) { break; } - message.bbcrId = reader.string(); + message.mbsFinalProduct = reader.string(); continue; } } @@ -7453,59 +17644,161 @@ export const DeleteBoxBobbinCostRateRequest: MessageFns): DeleteBoxBobbinCostRateRequest { - return DeleteBoxBobbinCostRateRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateMBSpinRequest { + return UpdateMBSpinRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteBoxBobbinCostRateRequest { - const message = createBaseDeleteBoxBobbinCostRateRequest(); - message.bbcId = object.bbcId ?? ""; - message.bbcrId = object.bbcrId ?? ""; + fromPartial(object: DeepPartial): UpdateMBSpinRequest { + const message = createBaseUpdateMBSpinRequest(); + message.mbhId = object.mbhId ?? ""; + message.mbsId = object.mbsId ?? ""; + message.mbsMgtName = object.mbsMgtName ?? undefined; + message.mbsDenier = object.mbsDenier ?? undefined; + message.mbsFilament = object.mbsFilament ?? undefined; + message.mbsDozing = object.mbsDozing ?? undefined; + message.mbsMbCosting = object.mbsMbCosting ?? undefined; + message.mbsIsActive = object.mbsIsActive ?? undefined; + message.mbsCc = object.mbsCc ?? undefined; + message.mbsCostRateMkt = object.mbsCostRateMkt ?? undefined; + message.mbsStatus = object.mbsStatus ?? undefined; + message.mbsLdrPrsn = object.mbsLdrPrsn ?? undefined; + message.mbsFinalProduct = object.mbsFinalProduct ?? undefined; return message; }, }; -function createBaseDeleteBoxBobbinCostRateResponse(): DeleteBoxBobbinCostRateResponse { - return { base: undefined }; +function createBaseUpdateMBSpinResponse(): UpdateMBSpinResponse { + return { base: undefined, data: undefined }; } -export const DeleteBoxBobbinCostRateResponse: MessageFns = { - encode(message: DeleteBoxBobbinCostRateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const UpdateMBSpinResponse: MessageFns = { + encode(message: UpdateMBSpinResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } + if (message.data !== undefined) { + MBSpin.encode(message.data, writer.uint32(18).fork()).join(); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteBoxBobbinCostRateResponse { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMBSpinResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteBoxBobbinCostRateResponse(); + const message = createBaseUpdateMBSpinResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -7517,6 +17810,14 @@ export const DeleteBoxBobbinCostRateResponse: MessageFns): DeleteBoxBobbinCostRateResponse { - return DeleteBoxBobbinCostRateResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateMBSpinResponse { + return UpdateMBSpinResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteBoxBobbinCostRateResponse { - const message = createBaseDeleteBoxBobbinCostRateResponse(); + fromPartial(object: DeepPartial): UpdateMBSpinResponse { + const message = createBaseUpdateMBSpinResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MBSpin.fromPartial(object.data) : undefined; return message; }, }; -function createBaseExportBoxBobbinCostsRequest(): ExportBoxBobbinCostsRequest { - return { activeFilter: 0 }; +function createBaseDeleteMBSpinRequest(): DeleteMBSpinRequest { + return { mbhId: "", mbsId: "" }; } -export const ExportBoxBobbinCostsRequest: MessageFns = { - encode(message: ExportBoxBobbinCostsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.activeFilter !== 0) { - writer.uint32(8).int32(message.activeFilter); +export const DeleteMBSpinRequest: MessageFns = { + encode(message: DeleteMBSpinRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); + } + if (message.mbsId !== "") { + writer.uint32(18).string(message.mbsId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportBoxBobbinCostsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMBSpinRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportBoxBobbinCostsRequest(); + const message = createBaseDeleteMBSpinRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 8) { + if (tag !== 10) { break; } - message.activeFilter = reader.int32() as any; + message.mbhId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.mbsId = reader.string(); continue; } } @@ -7586,56 +17905,59 @@ export const ExportBoxBobbinCostsRequest: MessageFns): ExportBoxBobbinCostsRequest { - return ExportBoxBobbinCostsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMBSpinRequest { + return DeleteMBSpinRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportBoxBobbinCostsRequest { - const message = createBaseExportBoxBobbinCostsRequest(); - message.activeFilter = object.activeFilter ?? 0; + fromPartial(object: DeepPartial): DeleteMBSpinRequest { + const message = createBaseDeleteMBSpinRequest(); + message.mbhId = object.mbhId ?? ""; + message.mbsId = object.mbsId ?? ""; return message; }, }; -function createBaseExportBoxBobbinCostsResponse(): ExportBoxBobbinCostsResponse { - return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +function createBaseDeleteMBSpinResponse(): DeleteMBSpinResponse { + return { base: undefined }; } -export const ExportBoxBobbinCostsResponse: MessageFns = { - encode(message: ExportBoxBobbinCostsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DeleteMBSpinResponse: MessageFns = { + encode(message: DeleteMBSpinResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.fileContent.length !== 0) { - writer.uint32(18).bytes(message.fileContent); - } - if (message.fileName !== "") { - writer.uint32(26).string(message.fileName); - } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportBoxBobbinCostsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMBSpinResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportBoxBobbinCostsResponse(); + const message = createBaseDeleteMBSpinResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -7647,22 +17969,6 @@ export const ExportBoxBobbinCostsResponse: MessageFns): ExportBoxBobbinCostsResponse { - return ExportBoxBobbinCostsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMBSpinResponse { + return DeleteMBSpinResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportBoxBobbinCostsResponse { - const message = createBaseExportBoxBobbinCostsResponse(); + fromPartial(object: DeepPartial): DeleteMBSpinResponse { + const message = createBaseDeleteMBSpinResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; return message; }, }; -function createBaseImportBoxBobbinCostsRequest(): ImportBoxBobbinCostsRequest { - return { fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; +function createBaseListMBSpinsRequest(): ListMBSpinsRequest { + return { mbhId: "", page: 0, pageSize: 0, search: "", activeFilter: 0, sortBy: "", sortOrder: "" }; } -export const ImportBoxBobbinCostsRequest: MessageFns = { - encode(message: ImportBoxBobbinCostsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.fileContent.length !== 0) { - writer.uint32(10).bytes(message.fileContent); +export const ListMBSpinsRequest: MessageFns = { + encode(message: ListMBSpinsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } - if (message.fileName !== "") { - writer.uint32(18).string(message.fileName); + if (message.page !== 0) { + writer.uint32(16).int32(message.page); } - if (message.duplicateAction !== "") { - writer.uint32(26).string(message.duplicateAction); + if (message.pageSize !== 0) { + writer.uint32(24).int32(message.pageSize); + } + if (message.search !== "") { + writer.uint32(34).string(message.search); + } + if (message.activeFilter !== 0) { + writer.uint32(40).int32(message.activeFilter); + } + if (message.sortBy !== "") { + writer.uint32(50).string(message.sortBy); + } + if (message.sortOrder !== "") { + writer.uint32(58).string(message.sortOrder); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportBoxBobbinCostsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ListMBSpinsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportBoxBobbinCostsRequest(); + const message = createBaseListMBSpinsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -7746,23 +18044,55 @@ export const ImportBoxBobbinCostsRequest: MessageFns): ImportBoxBobbinCostsRequest { - return ImportBoxBobbinCostsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMBSpinsRequest { + return ListMBSpinsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ImportBoxBobbinCostsRequest { - const message = createBaseImportBoxBobbinCostsRequest(); - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; - message.duplicateAction = object.duplicateAction ?? ""; + fromPartial(object: DeepPartial): ListMBSpinsRequest { + const message = createBaseListMBSpinsRequest(); + message.mbhId = object.mbhId ?? ""; + message.page = object.page ?? 0; + message.pageSize = object.pageSize ?? 0; + message.search = object.search ?? ""; + message.activeFilter = object.activeFilter ?? 0; + message.sortBy = object.sortBy ?? ""; + message.sortOrder = object.sortOrder ?? ""; return message; }, }; -function createBaseImportBoxBobbinCostsResponse(): ImportBoxBobbinCostsResponse { - return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; +function createBaseListMBSpinsResponse(): ListMBSpinsResponse { + return { base: undefined, data: [], pagination: undefined }; } -export const ImportBoxBobbinCostsResponse: MessageFns = { - encode(message: ImportBoxBobbinCostsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListMBSpinsResponse: MessageFns = { + encode(message: ListMBSpinsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.successCount !== 0) { - writer.uint32(16).int32(message.successCount); - } - if (message.skippedCount !== 0) { - writer.uint32(24).int32(message.skippedCount); - } - if (message.failedCount !== 0) { - writer.uint32(32).int32(message.failedCount); + for (const v of message.data) { + MBSpin.encode(v!, writer.uint32(18).fork()).join(); } - for (const v of message.errors) { - ImportError.encode(v!, writer.uint32(42).fork()).join(); + if (message.pagination !== undefined) { + PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportBoxBobbinCostsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListMBSpinsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportBoxBobbinCostsResponse(); + const message = createBaseListMBSpinsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -7860,35 +18212,19 @@ export const ImportBoxBobbinCostsResponse: MessageFns ImportError.fromJSON(e)) : [], + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MBSpin.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: ImportBoxBobbinCostsResponse): unknown { + toJSON(message: ListMBSpinsResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.successCount !== 0) { - obj.successCount = Math.round(message.successCount); - } - if (message.skippedCount !== 0) { - obj.skippedCount = Math.round(message.skippedCount); - } - if (message.failedCount !== 0) { - obj.failedCount = Math.round(message.failedCount); + if (message.data?.length) { + obj.data = message.data.map((e) => MBSpin.toJSON(e)); } - if (message.errors?.length) { - obj.errors = message.errors.map((e) => ImportError.toJSON(e)); + if (message.pagination !== undefined) { + obj.pagination = PaginationResponse.toJSON(message.pagination); } return obj; }, - create(base?: DeepPartial): ImportBoxBobbinCostsResponse { - return ImportBoxBobbinCostsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMBSpinsResponse { + return ListMBSpinsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ImportBoxBobbinCostsResponse { - const message = createBaseImportBoxBobbinCostsResponse(); + fromPartial(object: DeepPartial): ListMBSpinsResponse { + const message = createBaseListMBSpinsResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.successCount = object.successCount ?? 0; - message.skippedCount = object.skippedCount ?? 0; - message.failedCount = object.failedCount ?? 0; - message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; + message.data = object.data?.map((e) => MBSpin.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PaginationResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseDownloadBoxBobbinCostTemplateRequest(): DownloadBoxBobbinCostTemplateRequest { - return {}; +function createBaseExportMBSpinsRequest(): ExportMBSpinsRequest { + return { mbhId: "" }; } -export const DownloadBoxBobbinCostTemplateRequest: MessageFns = { - encode(_: DownloadBoxBobbinCostTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ExportMBSpinsRequest: MessageFns = { + encode(message: ExportMBSpinsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DownloadBoxBobbinCostTemplateRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ExportMBSpinsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDownloadBoxBobbinCostTemplateRequest(); + const message = createBaseExportMBSpinsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.mbhId = reader.string(); + continue; + } } if ((tag & 7) === 4 || tag === 0) { break; @@ -7983,30 +18310,40 @@ export const DownloadBoxBobbinCostTemplateRequest: MessageFns): DownloadBoxBobbinCostTemplateRequest { - return DownloadBoxBobbinCostTemplateRequest.fromPartial(base ?? {}); - }, - fromPartial(_: DeepPartial): DownloadBoxBobbinCostTemplateRequest { - const message = createBaseDownloadBoxBobbinCostTemplateRequest(); + create(base?: DeepPartial): ExportMBSpinsRequest { + return ExportMBSpinsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExportMBSpinsRequest { + const message = createBaseExportMBSpinsRequest(); + message.mbhId = object.mbhId ?? ""; return message; }, }; -function createBaseDownloadBoxBobbinCostTemplateResponse(): DownloadBoxBobbinCostTemplateResponse { +function createBaseExportMBSpinsResponse(): ExportMBSpinsResponse { return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; } -export const DownloadBoxBobbinCostTemplateResponse: MessageFns = { - encode(message: DownloadBoxBobbinCostTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ExportMBSpinsResponse: MessageFns = { + encode(message: ExportMBSpinsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } @@ -8019,10 +18356,10 @@ export const DownloadBoxBobbinCostTemplateResponse: MessageFns>> 3) { @@ -8059,7 +18396,7 @@ export const DownloadBoxBobbinCostTemplateResponse: MessageFns): DownloadBoxBobbinCostTemplateResponse { - return DownloadBoxBobbinCostTemplateResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ExportMBSpinsResponse { + return ExportMBSpinsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DownloadBoxBobbinCostTemplateResponse { - const message = createBaseDownloadBoxBobbinCostTemplateResponse(); + fromPartial(object: DeepPartial): ExportMBSpinsResponse { + const message = createBaseExportMBSpinsResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; @@ -8103,40 +18440,31 @@ export const DownloadBoxBobbinCostTemplateResponse: MessageFns = { - encode(message: Intermingling, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.intmId !== "") { - writer.uint32(10).string(message.intmId); - } - if (message.intmCode !== "") { - writer.uint32(18).string(message.intmCode); - } - if (message.intmName !== "") { - writer.uint32(26).string(message.intmName); - } - if (message.intmCostPerKg !== 0) { - writer.uint32(33).double(message.intmCostPerKg); +export const ImportMBSpinsRequest: MessageFns = { + encode(message: ImportMBSpinsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } - if (message.isActive !== false) { - writer.uint32(40).bool(message.isActive); + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); } - if (message.notes !== "") { - writer.uint32(50).string(message.notes); + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); } - if (message.audit !== undefined) { - AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); + if (message.duplicateAction !== "") { + writer.uint32(34).string(message.duplicateAction); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): Intermingling { + decode(input: BinaryReader | Uint8Array, length?: number): ImportMBSpinsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseIntermingling(); + const message = createBaseImportMBSpinsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -8145,7 +18473,7 @@ export const Intermingling: MessageFns = { break; } - message.intmId = reader.string(); + message.mbhId = reader.string(); continue; } case 2: { @@ -8153,7 +18481,7 @@ export const Intermingling: MessageFns = { break; } - message.intmCode = reader.string(); + message.fileContent = reader.bytes(); continue; } case 3: { @@ -8161,176 +18489,7 @@ export const Intermingling: MessageFns = { break; } - message.intmName = reader.string(); - continue; - } - case 4: { - if (tag !== 33) { - break; - } - - message.intmCostPerKg = reader.double(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.isActive = reader.bool(); - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.notes = reader.string(); - continue; - } - case 16: { - if (tag !== 130) { - break; - } - - message.audit = AuditInfo.decode(reader, reader.uint32()); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): Intermingling { - return { - intmId: isSet(object.intmId) - ? globalThis.String(object.intmId) - : isSet(object.intm_id) - ? globalThis.String(object.intm_id) - : "", - intmCode: isSet(object.intmCode) - ? globalThis.String(object.intmCode) - : isSet(object.intm_code) - ? globalThis.String(object.intm_code) - : "", - intmName: isSet(object.intmName) - ? globalThis.String(object.intmName) - : isSet(object.intm_name) - ? globalThis.String(object.intm_name) - : "", - intmCostPerKg: isSet(object.intmCostPerKg) - ? globalThis.Number(object.intmCostPerKg) - : isSet(object.intm_cost_per_kg) - ? globalThis.Number(object.intm_cost_per_kg) - : 0, - isActive: isSet(object.isActive) - ? globalThis.Boolean(object.isActive) - : isSet(object.is_active) - ? globalThis.Boolean(object.is_active) - : false, - notes: isSet(object.notes) ? globalThis.String(object.notes) : "", - audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, - }; - }, - - toJSON(message: Intermingling): unknown { - const obj: any = {}; - if (message.intmId !== "") { - obj.intmId = message.intmId; - } - if (message.intmCode !== "") { - obj.intmCode = message.intmCode; - } - if (message.intmName !== "") { - obj.intmName = message.intmName; - } - if (message.intmCostPerKg !== 0) { - obj.intmCostPerKg = message.intmCostPerKg; - } - if (message.isActive !== false) { - obj.isActive = message.isActive; - } - if (message.notes !== "") { - obj.notes = message.notes; - } - if (message.audit !== undefined) { - obj.audit = AuditInfo.toJSON(message.audit); - } - return obj; - }, - - create(base?: DeepPartial): Intermingling { - return Intermingling.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): Intermingling { - const message = createBaseIntermingling(); - message.intmId = object.intmId ?? ""; - message.intmCode = object.intmCode ?? ""; - message.intmName = object.intmName ?? ""; - message.intmCostPerKg = object.intmCostPerKg ?? 0; - message.isActive = object.isActive ?? false; - message.notes = object.notes ?? ""; - message.audit = (object.audit !== undefined && object.audit !== null) - ? AuditInfo.fromPartial(object.audit) - : undefined; - return message; - }, -}; - -function createBaseCreateInterminglingRequest(): CreateInterminglingRequest { - return { intmCode: "", intmName: "", intmCostPerKg: 0, notes: "" }; -} - -export const CreateInterminglingRequest: MessageFns = { - encode(message: CreateInterminglingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.intmCode !== "") { - writer.uint32(10).string(message.intmCode); - } - if (message.intmName !== "") { - writer.uint32(18).string(message.intmName); - } - if (message.intmCostPerKg !== 0) { - writer.uint32(25).double(message.intmCostPerKg); - } - if (message.notes !== "") { - writer.uint32(34).string(message.notes); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): CreateInterminglingRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateInterminglingRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.intmCode = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.intmName = reader.string(); - continue; - } - case 3: { - if (tag !== 25) { - break; - } - - message.intmCostPerKg = reader.double(); + message.fileName = reader.string(); continue; } case 4: { @@ -8338,7 +18497,7 @@ export const CreateInterminglingRequest: MessageFns break; } - message.notes = reader.string(); + message.duplicateAction = reader.string(); continue; } } @@ -8350,76 +18509,89 @@ export const CreateInterminglingRequest: MessageFns return message; }, - fromJSON(object: any): CreateInterminglingRequest { + fromJSON(object: any): ImportMBSpinsRequest { return { - intmCode: isSet(object.intmCode) - ? globalThis.String(object.intmCode) - : isSet(object.intm_code) - ? globalThis.String(object.intm_code) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) : "", - intmName: isSet(object.intmName) - ? globalThis.String(object.intmName) - : isSet(object.intm_name) - ? globalThis.String(object.intm_name) + duplicateAction: isSet(object.duplicateAction) + ? globalThis.String(object.duplicateAction) + : isSet(object.duplicate_action) + ? globalThis.String(object.duplicate_action) : "", - intmCostPerKg: isSet(object.intmCostPerKg) - ? globalThis.Number(object.intmCostPerKg) - : isSet(object.intm_cost_per_kg) - ? globalThis.Number(object.intm_cost_per_kg) - : 0, - notes: isSet(object.notes) ? globalThis.String(object.notes) : "", }; }, - toJSON(message: CreateInterminglingRequest): unknown { + toJSON(message: ImportMBSpinsRequest): unknown { const obj: any = {}; - if (message.intmCode !== "") { - obj.intmCode = message.intmCode; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } - if (message.intmName !== "") { - obj.intmName = message.intmName; + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); } - if (message.intmCostPerKg !== 0) { - obj.intmCostPerKg = message.intmCostPerKg; + if (message.fileName !== "") { + obj.fileName = message.fileName; } - if (message.notes !== "") { - obj.notes = message.notes; + if (message.duplicateAction !== "") { + obj.duplicateAction = message.duplicateAction; } return obj; }, - create(base?: DeepPartial): CreateInterminglingRequest { - return CreateInterminglingRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ImportMBSpinsRequest { + return ImportMBSpinsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateInterminglingRequest { - const message = createBaseCreateInterminglingRequest(); - message.intmCode = object.intmCode ?? ""; - message.intmName = object.intmName ?? ""; - message.intmCostPerKg = object.intmCostPerKg ?? 0; - message.notes = object.notes ?? ""; + fromPartial(object: DeepPartial): ImportMBSpinsRequest { + const message = createBaseImportMBSpinsRequest(); + message.mbhId = object.mbhId ?? ""; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + message.duplicateAction = object.duplicateAction ?? ""; return message; }, }; -function createBaseCreateInterminglingResponse(): CreateInterminglingResponse { - return { base: undefined, data: undefined }; +function createBaseImportMBSpinsResponse(): ImportMBSpinsResponse { + return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; } -export const CreateInterminglingResponse: MessageFns = { - encode(message: CreateInterminglingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ImportMBSpinsResponse: MessageFns = { + encode(message: ImportMBSpinsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.data !== undefined) { - Intermingling.encode(message.data, writer.uint32(18).fork()).join(); + if (message.successCount !== 0) { + writer.uint32(16).int32(message.successCount); + } + if (message.skippedCount !== 0) { + writer.uint32(24).int32(message.skippedCount); + } + if (message.failedCount !== 0) { + writer.uint32(32).int32(message.failedCount); + } + for (const v of message.errors) { + ImportError.encode(v!, writer.uint32(42).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateInterminglingResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ImportMBSpinsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateInterminglingResponse(); + const message = createBaseImportMBSpinsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -8432,11 +18604,35 @@ export const CreateInterminglingResponse: MessageFns ImportError.fromJSON(e)) : [], }; }, - toJSON(message: CreateInterminglingResponse): unknown { + toJSON(message: ImportMBSpinsResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data !== undefined) { - obj.data = Intermingling.toJSON(message.data); + if (message.successCount !== 0) { + obj.successCount = Math.round(message.successCount); + } + if (message.skippedCount !== 0) { + obj.skippedCount = Math.round(message.skippedCount); + } + if (message.failedCount !== 0) { + obj.failedCount = Math.round(message.failedCount); + } + if (message.errors?.length) { + obj.errors = message.errors.map((e) => ImportError.toJSON(e)); } return obj; }, - create(base?: DeepPartial): CreateInterminglingResponse { - return CreateInterminglingResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ImportMBSpinsResponse { + return ImportMBSpinsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateInterminglingResponse { - const message = createBaseCreateInterminglingResponse(); + fromPartial(object: DeepPartial): ImportMBSpinsResponse { + const message = createBaseImportMBSpinsResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? Intermingling.fromPartial(object.data) - : undefined; + message.successCount = object.successCount ?? 0; + message.skippedCount = object.skippedCount ?? 0; + message.failedCount = object.failedCount ?? 0; + message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; return message; }, }; -function createBaseGetInterminglingRequest(): GetInterminglingRequest { - return { intmId: "" }; +function createBaseDownloadMBSpinTemplateRequest(): DownloadMBSpinTemplateRequest { + return { mbhId: "" }; } -export const GetInterminglingRequest: MessageFns = { - encode(message: GetInterminglingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.intmId !== "") { - writer.uint32(10).string(message.intmId); +export const DownloadMBSpinTemplateRequest: MessageFns = { + encode(message: DownloadMBSpinTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetInterminglingRequest { + decode(input: BinaryReader | Uint8Array, length?: number): DownloadMBSpinTemplateRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetInterminglingRequest(); + const message = createBaseDownloadMBSpinTemplateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -8505,7 +18726,7 @@ export const GetInterminglingRequest: MessageFns = { break; } - message.intmId = reader.string(); + message.mbhId = reader.string(); continue; } } @@ -8517,53 +18738,56 @@ export const GetInterminglingRequest: MessageFns = { return message; }, - fromJSON(object: any): GetInterminglingRequest { + fromJSON(object: any): DownloadMBSpinTemplateRequest { return { - intmId: isSet(object.intmId) - ? globalThis.String(object.intmId) - : isSet(object.intm_id) - ? globalThis.String(object.intm_id) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) : "", }; }, - toJSON(message: GetInterminglingRequest): unknown { + toJSON(message: DownloadMBSpinTemplateRequest): unknown { const obj: any = {}; - if (message.intmId !== "") { - obj.intmId = message.intmId; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } return obj; }, - create(base?: DeepPartial): GetInterminglingRequest { - return GetInterminglingRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): DownloadMBSpinTemplateRequest { + return DownloadMBSpinTemplateRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetInterminglingRequest { - const message = createBaseGetInterminglingRequest(); - message.intmId = object.intmId ?? ""; + fromPartial(object: DeepPartial): DownloadMBSpinTemplateRequest { + const message = createBaseDownloadMBSpinTemplateRequest(); + message.mbhId = object.mbhId ?? ""; return message; }, }; -function createBaseGetInterminglingResponse(): GetInterminglingResponse { - return { base: undefined, data: undefined }; +function createBaseDownloadMBSpinTemplateResponse(): DownloadMBSpinTemplateResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; } -export const GetInterminglingResponse: MessageFns = { - encode(message: GetInterminglingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DownloadMBSpinTemplateResponse: MessageFns = { + encode(message: DownloadMBSpinTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.data !== undefined) { - Intermingling.encode(message.data, writer.uint32(18).fork()).join(); + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetInterminglingResponse { + decode(input: BinaryReader | Uint8Array, length?: number): DownloadMBSpinTemplateResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetInterminglingResponse(); + const message = createBaseDownloadMBSpinTemplateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -8580,7 +18804,15 @@ export const GetInterminglingResponse: MessageFns = { break; } - message.data = Intermingling.decode(reader, reader.uint32()); + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); continue; } } @@ -8592,67 +18824,72 @@ export const GetInterminglingResponse: MessageFns = { return message; }, - fromJSON(object: any): GetInterminglingResponse { + fromJSON(object: any): DownloadMBSpinTemplateResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? Intermingling.fromJSON(object.data) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", }; }, - toJSON(message: GetInterminglingResponse): unknown { + toJSON(message: DownloadMBSpinTemplateResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data !== undefined) { - obj.data = Intermingling.toJSON(message.data); + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; } return obj; }, - create(base?: DeepPartial): GetInterminglingResponse { - return GetInterminglingResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): DownloadMBSpinTemplateResponse { + return DownloadMBSpinTemplateResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetInterminglingResponse { - const message = createBaseGetInterminglingResponse(); + fromPartial(object: DeepPartial): DownloadMBSpinTemplateResponse { + const message = createBaseDownloadMBSpinTemplateResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? Intermingling.fromPartial(object.data) - : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; return message; }, }; -function createBaseUpdateInterminglingRequest(): UpdateInterminglingRequest { - return { intmId: "", intmName: undefined, intmCostPerKg: undefined, notes: undefined, isActive: undefined }; +function createBaseGetLookupFillValuesRequest(): GetLookupFillValuesRequest { + return { lookupMasterCode: "", selectedKey: "", sourceParamCode: "" }; } -export const UpdateInterminglingRequest: MessageFns = { - encode(message: UpdateInterminglingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.intmId !== "") { - writer.uint32(10).string(message.intmId); - } - if (message.intmName !== undefined) { - writer.uint32(18).string(message.intmName); - } - if (message.intmCostPerKg !== undefined) { - writer.uint32(25).double(message.intmCostPerKg); +export const GetLookupFillValuesRequest: MessageFns = { + encode(message: GetLookupFillValuesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.lookupMasterCode !== "") { + writer.uint32(10).string(message.lookupMasterCode); } - if (message.notes !== undefined) { - writer.uint32(34).string(message.notes); + if (message.selectedKey !== "") { + writer.uint32(18).string(message.selectedKey); } - if (message.isActive !== undefined) { - writer.uint32(40).bool(message.isActive); + if (message.sourceParamCode !== "") { + writer.uint32(26).string(message.sourceParamCode); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateInterminglingRequest { + decode(input: BinaryReader | Uint8Array, length?: number): GetLookupFillValuesRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateInterminglingRequest(); + const message = createBaseGetLookupFillValuesRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -8661,7 +18898,7 @@ export const UpdateInterminglingRequest: MessageFns break; } - message.intmId = reader.string(); + message.lookupMasterCode = reader.string(); continue; } case 2: { @@ -8669,31 +18906,15 @@ export const UpdateInterminglingRequest: MessageFns break; } - message.intmName = reader.string(); + message.selectedKey = reader.string(); continue; } case 3: { - if (tag !== 25) { - break; - } - - message.intmCostPerKg = reader.double(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.notes = reader.string(); - continue; - } - case 5: { - if (tag !== 40) { + if (tag !== 26) { break; } - message.isActive = reader.bool(); + message.sourceParamCode = reader.string(); continue; } } @@ -8705,85 +18926,77 @@ export const UpdateInterminglingRequest: MessageFns return message; }, - fromJSON(object: any): UpdateInterminglingRequest { + fromJSON(object: any): GetLookupFillValuesRequest { return { - intmId: isSet(object.intmId) - ? globalThis.String(object.intmId) - : isSet(object.intm_id) - ? globalThis.String(object.intm_id) + lookupMasterCode: isSet(object.lookupMasterCode) + ? globalThis.String(object.lookupMasterCode) + : isSet(object.lookup_master_code) + ? globalThis.String(object.lookup_master_code) + : "", + selectedKey: isSet(object.selectedKey) + ? globalThis.String(object.selectedKey) + : isSet(object.selected_key) + ? globalThis.String(object.selected_key) + : "", + sourceParamCode: isSet(object.sourceParamCode) + ? globalThis.String(object.sourceParamCode) + : isSet(object.source_param_code) + ? globalThis.String(object.source_param_code) : "", - intmName: isSet(object.intmName) - ? globalThis.String(object.intmName) - : isSet(object.intm_name) - ? globalThis.String(object.intm_name) - : undefined, - intmCostPerKg: isSet(object.intmCostPerKg) - ? globalThis.Number(object.intmCostPerKg) - : isSet(object.intm_cost_per_kg) - ? globalThis.Number(object.intm_cost_per_kg) - : undefined, - notes: isSet(object.notes) ? globalThis.String(object.notes) : undefined, - isActive: isSet(object.isActive) - ? globalThis.Boolean(object.isActive) - : isSet(object.is_active) - ? globalThis.Boolean(object.is_active) - : undefined, }; }, - toJSON(message: UpdateInterminglingRequest): unknown { + toJSON(message: GetLookupFillValuesRequest): unknown { const obj: any = {}; - if (message.intmId !== "") { - obj.intmId = message.intmId; - } - if (message.intmName !== undefined) { - obj.intmName = message.intmName; - } - if (message.intmCostPerKg !== undefined) { - obj.intmCostPerKg = message.intmCostPerKg; + if (message.lookupMasterCode !== "") { + obj.lookupMasterCode = message.lookupMasterCode; } - if (message.notes !== undefined) { - obj.notes = message.notes; + if (message.selectedKey !== "") { + obj.selectedKey = message.selectedKey; } - if (message.isActive !== undefined) { - obj.isActive = message.isActive; + if (message.sourceParamCode !== "") { + obj.sourceParamCode = message.sourceParamCode; } return obj; }, - create(base?: DeepPartial): UpdateInterminglingRequest { - return UpdateInterminglingRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): GetLookupFillValuesRequest { + return GetLookupFillValuesRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateInterminglingRequest { - const message = createBaseUpdateInterminglingRequest(); - message.intmId = object.intmId ?? ""; - message.intmName = object.intmName ?? undefined; - message.intmCostPerKg = object.intmCostPerKg ?? undefined; - message.notes = object.notes ?? undefined; - message.isActive = object.isActive ?? undefined; + fromPartial(object: DeepPartial): GetLookupFillValuesRequest { + const message = createBaseGetLookupFillValuesRequest(); + message.lookupMasterCode = object.lookupMasterCode ?? ""; + message.selectedKey = object.selectedKey ?? ""; + message.sourceParamCode = object.sourceParamCode ?? ""; return message; }, }; -function createBaseUpdateInterminglingResponse(): UpdateInterminglingResponse { - return { base: undefined, data: undefined }; +function createBaseGetLookupFillValuesResponse(): GetLookupFillValuesResponse { + return { base: undefined, numericFills: {}, textFills: {}, displayLabel: "" }; } -export const UpdateInterminglingResponse: MessageFns = { - encode(message: UpdateInterminglingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const GetLookupFillValuesResponse: MessageFns = { + encode(message: GetLookupFillValuesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.data !== undefined) { - Intermingling.encode(message.data, writer.uint32(18).fork()).join(); + globalThis.Object.entries(message.numericFills).forEach(([key, value]: [string, number]) => { + GetLookupFillValuesResponse_NumericFillsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); + }); + globalThis.Object.entries(message.textFills).forEach(([key, value]: [string, string]) => { + GetLookupFillValuesResponse_TextFillsEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); + }); + if (message.displayLabel !== "") { + writer.uint32(34).string(message.displayLabel); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateInterminglingResponse { + decode(input: BinaryReader | Uint8Array, length?: number): GetLookupFillValuesResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateInterminglingResponse(); + const message = createBaseGetLookupFillValuesResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -8800,7 +19013,29 @@ export const UpdateInterminglingResponse: MessageFns { + acc[key] = globalThis.Number(value); + return acc; + }, + {}, + ) + : isObject(object.numeric_fills) + ? (globalThis.Object.entries(object.numeric_fills) as [string, any][]).reduce( + (acc: { [key: string]: number }, [key, value]: [string, any]) => { + acc[key] = globalThis.Number(value); + return acc; + }, + {}, + ) + : {}, + textFills: isObject(object.textFills) + ? (globalThis.Object.entries(object.textFills) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : isObject(object.text_fills) + ? (globalThis.Object.entries(object.text_fills) as [string, any][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, any]) => { + acc[key] = globalThis.String(value); + return acc; + }, + {}, + ) + : {}, + displayLabel: isSet(object.displayLabel) + ? globalThis.String(object.displayLabel) + : isSet(object.display_label) + ? globalThis.String(object.display_label) + : "", }; }, - toJSON(message: UpdateInterminglingResponse): unknown { + toJSON(message: GetLookupFillValuesResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data !== undefined) { - obj.data = Intermingling.toJSON(message.data); + if (message.numericFills) { + const entries = globalThis.Object.entries(message.numericFills) as [string, number][]; + if (entries.length > 0) { + obj.numericFills = {}; + entries.forEach(([k, v]) => { + obj.numericFills[k] = v; + }); + } + } + if (message.textFills) { + const entries = globalThis.Object.entries(message.textFills) as [string, string][]; + if (entries.length > 0) { + obj.textFills = {}; + entries.forEach(([k, v]) => { + obj.textFills[k] = v; + }); + } + } + if (message.displayLabel !== "") { + obj.displayLabel = message.displayLabel; } return obj; }, - create(base?: DeepPartial): UpdateInterminglingResponse { - return UpdateInterminglingResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): GetLookupFillValuesResponse { + return GetLookupFillValuesResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateInterminglingResponse { - const message = createBaseUpdateInterminglingResponse(); + fromPartial(object: DeepPartial): GetLookupFillValuesResponse { + const message = createBaseGetLookupFillValuesResponse(); message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? Intermingling.fromPartial(object.data) + ? BaseResponse.fromPartial(object.base) : undefined; + message.numericFills = (globalThis.Object.entries(object.numericFills ?? {}) as [string, number][]).reduce( + (acc: { [key: string]: number }, [key, value]: [string, number]) => { + if (value !== undefined) { + acc[key] = globalThis.Number(value); + } + return acc; + }, + {}, + ); + message.textFills = (globalThis.Object.entries(object.textFills ?? {}) as [string, string][]).reduce( + (acc: { [key: string]: string }, [key, value]: [string, string]) => { + if (value !== undefined) { + acc[key] = globalThis.String(value); + } + return acc; + }, + {}, + ); + message.displayLabel = object.displayLabel ?? ""; return message; }, }; -function createBaseDeleteInterminglingRequest(): DeleteInterminglingRequest { - return { intmId: "" }; +function createBaseGetLookupFillValuesResponse_NumericFillsEntry(): GetLookupFillValuesResponse_NumericFillsEntry { + return { key: "", value: 0 }; } -export const DeleteInterminglingRequest: MessageFns = { - encode(message: DeleteInterminglingRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.intmId !== "") { - writer.uint32(10).string(message.intmId); - } - return writer; - }, +export const GetLookupFillValuesResponse_NumericFillsEntry: MessageFns = + { + encode( + message: GetLookupFillValuesResponse_NumericFillsEntry, + writer: BinaryWriter = new BinaryWriter(), + ): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== 0) { + writer.uint32(17).double(message.value); + } + return writer; + }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteInterminglingRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteInterminglingRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; + decode(input: BinaryReader | Uint8Array, length?: number): GetLookupFillValuesResponse_NumericFillsEntry { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetLookupFillValuesResponse_NumericFillsEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.key = reader.string(); + continue; } + case 2: { + if (tag !== 17) { + break; + } - message.intmId = reader.string(); - continue; + message.value = reader.double(); + continue; + } } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, + return message; + }, - fromJSON(object: any): DeleteInterminglingRequest { - return { - intmId: isSet(object.intmId) - ? globalThis.String(object.intmId) - : isSet(object.intm_id) - ? globalThis.String(object.intm_id) - : "", - }; - }, + fromJSON(object: any): GetLookupFillValuesResponse_NumericFillsEntry { + return { + key: isSet(object.key) ? globalThis.String(object.key) : "", + value: isSet(object.value) ? globalThis.Number(object.value) : 0, + }; + }, - toJSON(message: DeleteInterminglingRequest): unknown { - const obj: any = {}; - if (message.intmId !== "") { - obj.intmId = message.intmId; - } - return obj; - }, + toJSON(message: GetLookupFillValuesResponse_NumericFillsEntry): unknown { + const obj: any = {}; + if (message.key !== "") { + obj.key = message.key; + } + if (message.value !== 0) { + obj.value = message.value; + } + return obj; + }, - create(base?: DeepPartial): DeleteInterminglingRequest { - return DeleteInterminglingRequest.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): DeleteInterminglingRequest { - const message = createBaseDeleteInterminglingRequest(); - message.intmId = object.intmId ?? ""; - return message; - }, -}; + create( + base?: DeepPartial, + ): GetLookupFillValuesResponse_NumericFillsEntry { + return GetLookupFillValuesResponse_NumericFillsEntry.fromPartial(base ?? {}); + }, + fromPartial( + object: DeepPartial, + ): GetLookupFillValuesResponse_NumericFillsEntry { + const message = createBaseGetLookupFillValuesResponse_NumericFillsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? 0; + return message; + }, + }; -function createBaseDeleteInterminglingResponse(): DeleteInterminglingResponse { - return { base: undefined }; +function createBaseGetLookupFillValuesResponse_TextFillsEntry(): GetLookupFillValuesResponse_TextFillsEntry { + return { key: "", value: "" }; } -export const DeleteInterminglingResponse: MessageFns = { - encode(message: DeleteInterminglingResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); +export const GetLookupFillValuesResponse_TextFillsEntry: MessageFns = { + encode(message: GetLookupFillValuesResponse_TextFillsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.key !== "") { + writer.uint32(10).string(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteInterminglingResponse { + decode(input: BinaryReader | Uint8Array, length?: number): GetLookupFillValuesResponse_TextFillsEntry { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteInterminglingResponse(); + const message = createBaseGetLookupFillValuesResponse_TextFillsEntry(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -8933,7 +19263,15 @@ export const DeleteInterminglingResponse: MessageFns): DeleteInterminglingResponse { - return DeleteInterminglingResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): GetLookupFillValuesResponse_TextFillsEntry { + return GetLookupFillValuesResponse_TextFillsEntry.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteInterminglingResponse { - const message = createBaseDeleteInterminglingResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; + fromPartial( + object: DeepPartial, + ): GetLookupFillValuesResponse_TextFillsEntry { + const message = createBaseGetLookupFillValuesResponse_TextFillsEntry(); + message.key = object.key ?? ""; + message.value = object.value ?? ""; return message; }, }; -function createBaseListInterminglingsRequest(): ListInterminglingsRequest { - return { page: 0, pageSize: 0, search: "", activeFilter: 0, sortBy: "", sortOrder: "" }; +function createBaseLookupMaster(): LookupMaster { + return { + lmCode: "", + lmDisplayName: "", + lmApiPath: "", + lmCodeField: "", + lmLabelField: "", + lmIsActive: false, + lmTableName: "", + }; } -export const ListInterminglingsRequest: MessageFns = { - encode(message: ListInterminglingsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.page !== 0) { - writer.uint32(8).int32(message.page); +export const LookupMaster: MessageFns = { + encode(message: LookupMaster, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.lmCode !== "") { + writer.uint32(10).string(message.lmCode); } - if (message.pageSize !== 0) { - writer.uint32(16).int32(message.pageSize); + if (message.lmDisplayName !== "") { + writer.uint32(18).string(message.lmDisplayName); } - if (message.search !== "") { - writer.uint32(26).string(message.search); + if (message.lmApiPath !== "") { + writer.uint32(26).string(message.lmApiPath); } - if (message.activeFilter !== 0) { - writer.uint32(32).int32(message.activeFilter); + if (message.lmCodeField !== "") { + writer.uint32(34).string(message.lmCodeField); } - if (message.sortBy !== "") { - writer.uint32(42).string(message.sortBy); + if (message.lmLabelField !== "") { + writer.uint32(42).string(message.lmLabelField); } - if (message.sortOrder !== "") { - writer.uint32(50).string(message.sortOrder); + if (message.lmIsActive !== false) { + writer.uint32(48).bool(message.lmIsActive); + } + if (message.lmTableName !== "") { + writer.uint32(58).string(message.lmTableName); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListInterminglingsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): LookupMaster { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListInterminglingsRequest(); + const message = createBaseLookupMaster(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 8) { + if (tag !== 10) { break; } - message.page = reader.int32(); + message.lmCode = reader.string(); continue; } case 2: { - if (tag !== 16) { + if (tag !== 18) { break; } - message.pageSize = reader.int32(); + message.lmDisplayName = reader.string(); continue; } case 3: { @@ -9024,15 +19380,15 @@ export const ListInterminglingsRequest: MessageFns = break; } - message.search = reader.string(); + message.lmApiPath = reader.string(); continue; } case 4: { - if (tag !== 32) { + if (tag !== 34) { break; } - message.activeFilter = reader.int32() as any; + message.lmCodeField = reader.string(); continue; } case 5: { @@ -9040,15 +19396,23 @@ export const ListInterminglingsRequest: MessageFns = break; } - message.sortBy = reader.string(); + message.lmLabelField = reader.string(); continue; } case 6: { - if (tag !== 50) { + if (tag !== 48) { break; } - message.sortOrder = reader.string(); + message.lmIsActive = reader.bool(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.lmTableName = reader.string(); continue; } } @@ -9060,93 +19424,171 @@ export const ListInterminglingsRequest: MessageFns = return message; }, - fromJSON(object: any): ListInterminglingsRequest { + fromJSON(object: any): LookupMaster { return { - page: isSet(object.page) ? globalThis.Number(object.page) : 0, - pageSize: isSet(object.pageSize) - ? globalThis.Number(object.pageSize) - : isSet(object.page_size) - ? globalThis.Number(object.page_size) - : 0, - search: isSet(object.search) ? globalThis.String(object.search) : "", - activeFilter: isSet(object.activeFilter) - ? activeFilterFromJSON(object.activeFilter) - : isSet(object.active_filter) - ? activeFilterFromJSON(object.active_filter) - : 0, - sortBy: isSet(object.sortBy) - ? globalThis.String(object.sortBy) - : isSet(object.sort_by) - ? globalThis.String(object.sort_by) + lmCode: isSet(object.lmCode) + ? globalThis.String(object.lmCode) + : isSet(object.lm_code) + ? globalThis.String(object.lm_code) : "", - sortOrder: isSet(object.sortOrder) - ? globalThis.String(object.sortOrder) - : isSet(object.sort_order) - ? globalThis.String(object.sort_order) + lmDisplayName: isSet(object.lmDisplayName) + ? globalThis.String(object.lmDisplayName) + : isSet(object.lm_display_name) + ? globalThis.String(object.lm_display_name) + : "", + lmApiPath: isSet(object.lmApiPath) + ? globalThis.String(object.lmApiPath) + : isSet(object.lm_api_path) + ? globalThis.String(object.lm_api_path) + : "", + lmCodeField: isSet(object.lmCodeField) + ? globalThis.String(object.lmCodeField) + : isSet(object.lm_code_field) + ? globalThis.String(object.lm_code_field) + : "", + lmLabelField: isSet(object.lmLabelField) + ? globalThis.String(object.lmLabelField) + : isSet(object.lm_label_field) + ? globalThis.String(object.lm_label_field) + : "", + lmIsActive: isSet(object.lmIsActive) + ? globalThis.Boolean(object.lmIsActive) + : isSet(object.lm_is_active) + ? globalThis.Boolean(object.lm_is_active) + : false, + lmTableName: isSet(object.lmTableName) + ? globalThis.String(object.lmTableName) + : isSet(object.lm_table_name) + ? globalThis.String(object.lm_table_name) : "", }; }, - toJSON(message: ListInterminglingsRequest): unknown { + toJSON(message: LookupMaster): unknown { const obj: any = {}; - if (message.page !== 0) { - obj.page = Math.round(message.page); + if (message.lmCode !== "") { + obj.lmCode = message.lmCode; } - if (message.pageSize !== 0) { - obj.pageSize = Math.round(message.pageSize); + if (message.lmDisplayName !== "") { + obj.lmDisplayName = message.lmDisplayName; } - if (message.search !== "") { - obj.search = message.search; + if (message.lmApiPath !== "") { + obj.lmApiPath = message.lmApiPath; } - if (message.activeFilter !== 0) { - obj.activeFilter = activeFilterToJSON(message.activeFilter); + if (message.lmCodeField !== "") { + obj.lmCodeField = message.lmCodeField; } - if (message.sortBy !== "") { - obj.sortBy = message.sortBy; + if (message.lmLabelField !== "") { + obj.lmLabelField = message.lmLabelField; } - if (message.sortOrder !== "") { - obj.sortOrder = message.sortOrder; + if (message.lmIsActive !== false) { + obj.lmIsActive = message.lmIsActive; + } + if (message.lmTableName !== "") { + obj.lmTableName = message.lmTableName; } return obj; }, - create(base?: DeepPartial): ListInterminglingsRequest { - return ListInterminglingsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): LookupMaster { + return LookupMaster.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListInterminglingsRequest { - const message = createBaseListInterminglingsRequest(); - message.page = object.page ?? 0; - message.pageSize = object.pageSize ?? 0; - message.search = object.search ?? ""; - message.activeFilter = object.activeFilter ?? 0; - message.sortBy = object.sortBy ?? ""; - message.sortOrder = object.sortOrder ?? ""; + fromPartial(object: DeepPartial): LookupMaster { + const message = createBaseLookupMaster(); + message.lmCode = object.lmCode ?? ""; + message.lmDisplayName = object.lmDisplayName ?? ""; + message.lmApiPath = object.lmApiPath ?? ""; + message.lmCodeField = object.lmCodeField ?? ""; + message.lmLabelField = object.lmLabelField ?? ""; + message.lmIsActive = object.lmIsActive ?? false; + message.lmTableName = object.lmTableName ?? ""; return message; }, }; -function createBaseListInterminglingsResponse(): ListInterminglingsResponse { - return { base: undefined, data: [], pagination: undefined }; +function createBaseListLookupMastersRequest(): ListLookupMastersRequest { + return { activeOnly: false }; } -export const ListInterminglingsResponse: MessageFns = { - encode(message: ListInterminglingsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListLookupMastersRequest: MessageFns = { + encode(message: ListLookupMastersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.activeOnly !== false) { + writer.uint32(8).bool(message.activeOnly); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListLookupMastersRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListLookupMastersRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 8) { + break; + } + + message.activeOnly = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListLookupMastersRequest { + return { + activeOnly: isSet(object.activeOnly) + ? globalThis.Boolean(object.activeOnly) + : isSet(object.active_only) + ? globalThis.Boolean(object.active_only) + : false, + }; + }, + + toJSON(message: ListLookupMastersRequest): unknown { + const obj: any = {}; + if (message.activeOnly !== false) { + obj.activeOnly = message.activeOnly; + } + return obj; + }, + + create(base?: DeepPartial): ListLookupMastersRequest { + return ListLookupMastersRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListLookupMastersRequest { + const message = createBaseListLookupMastersRequest(); + message.activeOnly = object.activeOnly ?? false; + return message; + }, +}; + +function createBaseListLookupMastersResponse(): ListLookupMastersResponse { + return { base: undefined, data: [] }; +} + +export const ListLookupMastersResponse: MessageFns = { + encode(message: ListLookupMastersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } for (const v of message.data) { - Intermingling.encode(v!, writer.uint32(18).fork()).join(); - } - if (message.pagination !== undefined) { - PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); + LookupMaster.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListInterminglingsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListLookupMastersResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListInterminglingsResponse(); + const message = createBaseListLookupMastersResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -9163,15 +19605,7 @@ export const ListInterminglingsResponse: MessageFns break; } - message.data.push(Intermingling.decode(reader, reader.uint32())); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.pagination = PaginationResponse.decode(reader, reader.uint32()); + message.data.push(LookupMaster.decode(reader, reader.uint32())); continue; } } @@ -9183,69 +19617,117 @@ export const ListInterminglingsResponse: MessageFns return message; }, - fromJSON(object: any): ListInterminglingsResponse { + fromJSON(object: any): ListLookupMastersResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => Intermingling.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => LookupMaster.fromJSON(e)) : [], }; }, - toJSON(message: ListInterminglingsResponse): unknown { + toJSON(message: ListLookupMastersResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data?.length) { - obj.data = message.data.map((e) => Intermingling.toJSON(e)); - } - if (message.pagination !== undefined) { - obj.pagination = PaginationResponse.toJSON(message.pagination); + obj.data = message.data.map((e) => LookupMaster.toJSON(e)); } return obj; }, - create(base?: DeepPartial): ListInterminglingsResponse { - return ListInterminglingsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ListLookupMastersResponse { + return ListLookupMastersResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListInterminglingsResponse { - const message = createBaseListInterminglingsResponse(); + fromPartial(object: DeepPartial): ListLookupMastersResponse { + const message = createBaseListLookupMastersResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = object.data?.map((e) => Intermingling.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PaginationResponse.fromPartial(object.pagination) - : undefined; + message.data = object.data?.map((e) => LookupMaster.fromPartial(e)) || []; return message; }, }; -function createBaseExportInterminglingsRequest(): ExportInterminglingsRequest { - return { activeFilter: 0 }; -} - -export const ExportInterminglingsRequest: MessageFns = { - encode(message: ExportInterminglingsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.activeFilter !== 0) { - writer.uint32(8).int32(message.activeFilter); +function createBaseLookupMasterColumn(): LookupMasterColumn { + return { lmcMasterCode: "", lmcColumnName: "", lmcDisplayName: "", lmcDataType: "", lmcSortOrder: 0, lmcId: "" }; +} + +export const LookupMasterColumn: MessageFns = { + encode(message: LookupMasterColumn, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.lmcMasterCode !== "") { + writer.uint32(10).string(message.lmcMasterCode); + } + if (message.lmcColumnName !== "") { + writer.uint32(18).string(message.lmcColumnName); + } + if (message.lmcDisplayName !== "") { + writer.uint32(26).string(message.lmcDisplayName); + } + if (message.lmcDataType !== "") { + writer.uint32(34).string(message.lmcDataType); + } + if (message.lmcSortOrder !== 0) { + writer.uint32(40).int32(message.lmcSortOrder); + } + if (message.lmcId !== "") { + writer.uint32(50).string(message.lmcId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportInterminglingsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): LookupMasterColumn { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportInterminglingsRequest(); + const message = createBaseLookupMasterColumn(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 8) { + if (tag !== 10) { break; } - message.activeFilter = reader.int32() as any; + message.lmcMasterCode = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.lmcColumnName = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.lmcDisplayName = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.lmcDataType = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.lmcSortOrder = reader.int32(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.lmcId = reader.string(); continue; } } @@ -9257,56 +19739,95 @@ export const ExportInterminglingsRequest: MessageFns): ExportInterminglingsRequest { - return ExportInterminglingsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): LookupMasterColumn { + return LookupMasterColumn.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportInterminglingsRequest { - const message = createBaseExportInterminglingsRequest(); - message.activeFilter = object.activeFilter ?? 0; + fromPartial(object: DeepPartial): LookupMasterColumn { + const message = createBaseLookupMasterColumn(); + message.lmcMasterCode = object.lmcMasterCode ?? ""; + message.lmcColumnName = object.lmcColumnName ?? ""; + message.lmcDisplayName = object.lmcDisplayName ?? ""; + message.lmcDataType = object.lmcDataType ?? ""; + message.lmcSortOrder = object.lmcSortOrder ?? 0; + message.lmcId = object.lmcId ?? ""; return message; }, }; -function createBaseExportInterminglingsResponse(): ExportInterminglingsResponse { - return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +function createBaseListLookupMasterColumnsRequest(): ListLookupMasterColumnsRequest { + return { masterCode: "" }; } -export const ExportInterminglingsResponse: MessageFns = { - encode(message: ExportInterminglingsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); - } - if (message.fileContent.length !== 0) { - writer.uint32(18).bytes(message.fileContent); - } - if (message.fileName !== "") { - writer.uint32(26).string(message.fileName); +export const ListLookupMasterColumnsRequest: MessageFns = { + encode(message: ListLookupMasterColumnsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.masterCode !== "") { + writer.uint32(10).string(message.masterCode); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportInterminglingsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListLookupMasterColumnsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportInterminglingsResponse(); + const message = createBaseListLookupMasterColumnsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -9315,23 +19836,7 @@ export const ExportInterminglingsResponse: MessageFns): ExportInterminglingsResponse { - return ExportInterminglingsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ListLookupMasterColumnsRequest { + return ListLookupMasterColumnsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportInterminglingsResponse { - const message = createBaseExportInterminglingsResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; + fromPartial(object: DeepPartial): ListLookupMasterColumnsRequest { + const message = createBaseListLookupMasterColumnsRequest(); + message.masterCode = object.masterCode ?? ""; return message; }, }; -function createBaseImportInterminglingsRequest(): ImportInterminglingsRequest { - return { fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; +function createBaseListLookupMasterColumnsResponse(): ListLookupMasterColumnsResponse { + return { base: undefined, data: [] }; } -export const ImportInterminglingsRequest: MessageFns = { - encode(message: ImportInterminglingsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.fileContent.length !== 0) { - writer.uint32(10).bytes(message.fileContent); - } - if (message.fileName !== "") { - writer.uint32(18).string(message.fileName); +export const ListLookupMasterColumnsResponse: MessageFns = { + encode(message: ListLookupMasterColumnsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.duplicateAction !== "") { - writer.uint32(26).string(message.duplicateAction); + for (const v of message.data) { + LookupMasterColumn.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportInterminglingsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ListLookupMasterColumnsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportInterminglingsRequest(); + const message = createBaseListLookupMasterColumnsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -9417,7 +19903,7 @@ export const ImportInterminglingsRequest: MessageFns LookupMasterColumn.fromJSON(e)) : [], }; }, - toJSON(message: ImportInterminglingsRequest): unknown { + toJSON(message: ListLookupMasterColumnsResponse): unknown { const obj: any = {}; - if (message.fileContent.length !== 0) { - obj.fileContent = base64FromBytes(message.fileContent); - } - if (message.fileName !== "") { - obj.fileName = message.fileName; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); } - if (message.duplicateAction !== "") { - obj.duplicateAction = message.duplicateAction; + if (message.data?.length) { + obj.data = message.data.map((e) => LookupMasterColumn.toJSON(e)); } return obj; }, - create(base?: DeepPartial): ImportInterminglingsRequest { - return ImportInterminglingsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ListLookupMasterColumnsResponse { + return ListLookupMasterColumnsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ImportInterminglingsRequest { - const message = createBaseImportInterminglingsRequest(); - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; - message.duplicateAction = object.duplicateAction ?? ""; + fromPartial(object: DeepPartial): ListLookupMasterColumnsResponse { + const message = createBaseListLookupMasterColumnsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = object.data?.map((e) => LookupMasterColumn.fromPartial(e)) || []; return message; }, }; -function createBaseImportInterminglingsResponse(): ImportInterminglingsResponse { - return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; +function createBaseCreateLookupMasterRequest(): CreateLookupMasterRequest { + return { lmCode: "", lmDisplayName: "", lmApiPath: "", lmCodeField: "", lmLabelField: "", lmTableName: undefined }; } -export const ImportInterminglingsResponse: MessageFns = { - encode(message: ImportInterminglingsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); +export const CreateLookupMasterRequest: MessageFns = { + encode(message: CreateLookupMasterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.lmCode !== "") { + writer.uint32(10).string(message.lmCode); } - if (message.successCount !== 0) { - writer.uint32(16).int32(message.successCount); + if (message.lmDisplayName !== "") { + writer.uint32(18).string(message.lmDisplayName); } - if (message.skippedCount !== 0) { - writer.uint32(24).int32(message.skippedCount); + if (message.lmApiPath !== "") { + writer.uint32(26).string(message.lmApiPath); } - if (message.failedCount !== 0) { - writer.uint32(32).int32(message.failedCount); + if (message.lmCodeField !== "") { + writer.uint32(34).string(message.lmCodeField); } - for (const v of message.errors) { - ImportError.encode(v!, writer.uint32(42).fork()).join(); + if (message.lmLabelField !== "") { + writer.uint32(42).string(message.lmLabelField); + } + if (message.lmTableName !== undefined) { + writer.uint32(50).string(message.lmTableName); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportInterminglingsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): CreateLookupMasterRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportInterminglingsResponse(); + const message = createBaseCreateLookupMasterRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -9527,31 +19993,31 @@ export const ImportInterminglingsResponse: MessageFns ImportError.fromJSON(e)) : [], + lmCode: isSet(object.lmCode) + ? globalThis.String(object.lmCode) + : isSet(object.lm_code) + ? globalThis.String(object.lm_code) + : "", + lmDisplayName: isSet(object.lmDisplayName) + ? globalThis.String(object.lmDisplayName) + : isSet(object.lm_display_name) + ? globalThis.String(object.lm_display_name) + : "", + lmApiPath: isSet(object.lmApiPath) + ? globalThis.String(object.lmApiPath) + : isSet(object.lm_api_path) + ? globalThis.String(object.lm_api_path) + : "", + lmCodeField: isSet(object.lmCodeField) + ? globalThis.String(object.lmCodeField) + : isSet(object.lm_code_field) + ? globalThis.String(object.lm_code_field) + : "", + lmLabelField: isSet(object.lmLabelField) + ? globalThis.String(object.lmLabelField) + : isSet(object.lm_label_field) + ? globalThis.String(object.lm_label_field) + : "", + lmTableName: isSet(object.lmTableName) + ? globalThis.String(object.lmTableName) + : isSet(object.lm_table_name) + ? globalThis.String(object.lm_table_name) + : undefined, }; }, - toJSON(message: ImportInterminglingsResponse): unknown { + toJSON(message: CreateLookupMasterRequest): unknown { const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); + if (message.lmCode !== "") { + obj.lmCode = message.lmCode; } - if (message.successCount !== 0) { - obj.successCount = Math.round(message.successCount); + if (message.lmDisplayName !== "") { + obj.lmDisplayName = message.lmDisplayName; } - if (message.skippedCount !== 0) { - obj.skippedCount = Math.round(message.skippedCount); + if (message.lmApiPath !== "") { + obj.lmApiPath = message.lmApiPath; } - if (message.failedCount !== 0) { - obj.failedCount = Math.round(message.failedCount); + if (message.lmCodeField !== "") { + obj.lmCodeField = message.lmCodeField; } - if (message.errors?.length) { - obj.errors = message.errors.map((e) => ImportError.toJSON(e)); + if (message.lmLabelField !== "") { + obj.lmLabelField = message.lmLabelField; } - return obj; - }, - - create(base?: DeepPartial): ImportInterminglingsResponse { - return ImportInterminglingsResponse.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): ImportInterminglingsResponse { - const message = createBaseImportInterminglingsResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.successCount = object.successCount ?? 0; - message.skippedCount = object.skippedCount ?? 0; - message.failedCount = object.failedCount ?? 0; - message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseDownloadInterminglingTemplateRequest(): DownloadInterminglingTemplateRequest { - return {}; -} - -export const DownloadInterminglingTemplateRequest: MessageFns = { - encode(_: DownloadInterminglingTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): DownloadInterminglingTemplateRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDownloadInterminglingTemplateRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); + if (message.lmTableName !== undefined) { + obj.lmTableName = message.lmTableName; } - return message; - }, - - fromJSON(_: any): DownloadInterminglingTemplateRequest { - return {}; - }, - - toJSON(_: DownloadInterminglingTemplateRequest): unknown { - const obj: any = {}; return obj; }, - create(base?: DeepPartial): DownloadInterminglingTemplateRequest { - return DownloadInterminglingTemplateRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateLookupMasterRequest { + return CreateLookupMasterRequest.fromPartial(base ?? {}); }, - fromPartial(_: DeepPartial): DownloadInterminglingTemplateRequest { - const message = createBaseDownloadInterminglingTemplateRequest(); + fromPartial(object: DeepPartial): CreateLookupMasterRequest { + const message = createBaseCreateLookupMasterRequest(); + message.lmCode = object.lmCode ?? ""; + message.lmDisplayName = object.lmDisplayName ?? ""; + message.lmApiPath = object.lmApiPath ?? ""; + message.lmCodeField = object.lmCodeField ?? ""; + message.lmLabelField = object.lmLabelField ?? ""; + message.lmTableName = object.lmTableName ?? undefined; return message; }, }; -function createBaseDownloadInterminglingTemplateResponse(): DownloadInterminglingTemplateResponse { - return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +function createBaseCreateLookupMasterResponse(): CreateLookupMasterResponse { + return { base: undefined, data: undefined }; } -export const DownloadInterminglingTemplateResponse: MessageFns = { - encode(message: DownloadInterminglingTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const CreateLookupMasterResponse: MessageFns = { + encode(message: CreateLookupMasterResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.fileContent.length !== 0) { - writer.uint32(18).bytes(message.fileContent); - } - if (message.fileName !== "") { - writer.uint32(26).string(message.fileName); + if (message.data !== undefined) { + LookupMaster.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DownloadInterminglingTemplateResponse { + decode(input: BinaryReader | Uint8Array, length?: number): CreateLookupMasterResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDownloadInterminglingTemplateResponse(); + const message = createBaseCreateLookupMasterResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -9710,15 +20153,7 @@ export const DownloadInterminglingTemplateResponse: MessageFns): DownloadInterminglingTemplateResponse { - return DownloadInterminglingTemplateResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateLookupMasterResponse { + return CreateLookupMasterResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DownloadInterminglingTemplateResponse { - const message = createBaseDownloadInterminglingTemplateResponse(); + fromPartial(object: DeepPartial): CreateLookupMasterResponse { + const message = createBaseCreateLookupMasterResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; + message.data = (object.data !== undefined && object.data !== null) + ? LookupMaster.fromPartial(object.data) + : undefined; return message; }, }; -function createBaseProductGrade(): ProductGrade { - return { - pgId: "", - pgCode: "", - pgName: "", - pgDescription: "", - bcPerc: 0, - nonStdPerc: 0, - bcRecoveryRate: 0, - isActive: false, - notes: "", - pgDetailProduct: "", - pgGradeLabel: "", - stdSellingPrice: 0, - spValue: 0, - lossPct: undefined, - seqNo: undefined, - audit: undefined, - }; +function createBaseDeleteLookupMasterRequest(): DeleteLookupMasterRequest { + return { lmCode: "" }; } -export const ProductGrade: MessageFns = { - encode(message: ProductGrade, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.pgId !== "") { - writer.uint32(10).string(message.pgId); - } - if (message.pgCode !== "") { - writer.uint32(18).string(message.pgCode); - } - if (message.pgName !== "") { - writer.uint32(26).string(message.pgName); - } - if (message.pgDescription !== "") { - writer.uint32(34).string(message.pgDescription); - } - if (message.bcPerc !== 0) { - writer.uint32(41).double(message.bcPerc); - } - if (message.nonStdPerc !== 0) { - writer.uint32(49).double(message.nonStdPerc); - } - if (message.bcRecoveryRate !== 0) { - writer.uint32(57).double(message.bcRecoveryRate); - } - if (message.isActive !== false) { - writer.uint32(64).bool(message.isActive); - } - if (message.notes !== "") { - writer.uint32(74).string(message.notes); - } - if (message.pgDetailProduct !== "") { - writer.uint32(82).string(message.pgDetailProduct); - } - if (message.pgGradeLabel !== "") { - writer.uint32(90).string(message.pgGradeLabel); - } - if (message.stdSellingPrice !== 0) { - writer.uint32(97).double(message.stdSellingPrice); - } - if (message.spValue !== 0) { - writer.uint32(105).double(message.spValue); - } - if (message.lossPct !== undefined) { - writer.uint32(113).double(message.lossPct); - } - if (message.seqNo !== undefined) { - writer.uint32(120).int32(message.seqNo); - } - if (message.audit !== undefined) { - AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); +export const DeleteLookupMasterRequest: MessageFns = { + encode(message: DeleteLookupMasterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.lmCode !== "") { + writer.uint32(10).string(message.lmCode); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ProductGrade { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteLookupMasterRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseProductGrade(); + const message = createBaseDeleteLookupMasterRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -9860,127 +20222,71 @@ export const ProductGrade: MessageFns = { break; } - message.pgId = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.pgCode = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.pgName = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.pgDescription = reader.string(); - continue; - } - case 5: { - if (tag !== 41) { - break; - } - - message.bcPerc = reader.double(); - continue; - } - case 6: { - if (tag !== 49) { - break; - } - - message.nonStdPerc = reader.double(); - continue; - } - case 7: { - if (tag !== 57) { - break; - } - - message.bcRecoveryRate = reader.double(); - continue; - } - case 8: { - if (tag !== 64) { - break; - } - - message.isActive = reader.bool(); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.notes = reader.string(); - continue; - } - case 10: { - if (tag !== 82) { - break; - } - - message.pgDetailProduct = reader.string(); + message.lmCode = reader.string(); continue; } - case 11: { - if (tag !== 90) { - break; - } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, - message.pgGradeLabel = reader.string(); - continue; - } - case 12: { - if (tag !== 97) { - break; - } + fromJSON(object: any): DeleteLookupMasterRequest { + return { + lmCode: isSet(object.lmCode) + ? globalThis.String(object.lmCode) + : isSet(object.lm_code) + ? globalThis.String(object.lm_code) + : "", + }; + }, - message.stdSellingPrice = reader.double(); - continue; - } - case 13: { - if (tag !== 105) { - break; - } + toJSON(message: DeleteLookupMasterRequest): unknown { + const obj: any = {}; + if (message.lmCode !== "") { + obj.lmCode = message.lmCode; + } + return obj; + }, - message.spValue = reader.double(); - continue; - } - case 14: { - if (tag !== 113) { - break; - } + create(base?: DeepPartial): DeleteLookupMasterRequest { + return DeleteLookupMasterRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteLookupMasterRequest { + const message = createBaseDeleteLookupMasterRequest(); + message.lmCode = object.lmCode ?? ""; + return message; + }, +}; - message.lossPct = reader.double(); - continue; - } - case 15: { - if (tag !== 120) { - break; - } +function createBaseDeleteLookupMasterResponse(): DeleteLookupMasterResponse { + return { base: undefined }; +} - message.seqNo = reader.int32(); - continue; - } - case 16: { - if (tag !== 130) { +export const DeleteLookupMasterResponse: MessageFns = { + encode(message: DeleteLookupMasterResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteLookupMasterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteLookupMasterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { break; } - message.audit = AuditInfo.decode(reader, reader.uint32()); + message.base = BaseResponse.decode(reader, reader.uint32()); continue; } } @@ -9992,229 +20298,58 @@ export const ProductGrade: MessageFns = { return message; }, - fromJSON(object: any): ProductGrade { - return { - pgId: isSet(object.pgId) - ? globalThis.String(object.pgId) - : isSet(object.pg_id) - ? globalThis.String(object.pg_id) - : "", - pgCode: isSet(object.pgCode) - ? globalThis.String(object.pgCode) - : isSet(object.pg_code) - ? globalThis.String(object.pg_code) - : "", - pgName: isSet(object.pgName) - ? globalThis.String(object.pgName) - : isSet(object.pg_name) - ? globalThis.String(object.pg_name) - : "", - pgDescription: isSet(object.pgDescription) - ? globalThis.String(object.pgDescription) - : isSet(object.pg_description) - ? globalThis.String(object.pg_description) - : "", - bcPerc: isSet(object.bcPerc) - ? globalThis.Number(object.bcPerc) - : isSet(object.bc_perc) - ? globalThis.Number(object.bc_perc) - : 0, - nonStdPerc: isSet(object.nonStdPerc) - ? globalThis.Number(object.nonStdPerc) - : isSet(object.non_std_perc) - ? globalThis.Number(object.non_std_perc) - : 0, - bcRecoveryRate: isSet(object.bcRecoveryRate) - ? globalThis.Number(object.bcRecoveryRate) - : isSet(object.bc_recovery_rate) - ? globalThis.Number(object.bc_recovery_rate) - : 0, - isActive: isSet(object.isActive) - ? globalThis.Boolean(object.isActive) - : isSet(object.is_active) - ? globalThis.Boolean(object.is_active) - : false, - notes: isSet(object.notes) ? globalThis.String(object.notes) : "", - pgDetailProduct: isSet(object.pgDetailProduct) - ? globalThis.String(object.pgDetailProduct) - : isSet(object.pg_detail_product) - ? globalThis.String(object.pg_detail_product) - : "", - pgGradeLabel: isSet(object.pgGradeLabel) - ? globalThis.String(object.pgGradeLabel) - : isSet(object.pg_grade_label) - ? globalThis.String(object.pg_grade_label) - : "", - stdSellingPrice: isSet(object.stdSellingPrice) - ? globalThis.Number(object.stdSellingPrice) - : isSet(object.std_selling_price) - ? globalThis.Number(object.std_selling_price) - : 0, - spValue: isSet(object.spValue) - ? globalThis.Number(object.spValue) - : isSet(object.sp_value) - ? globalThis.Number(object.sp_value) - : 0, - lossPct: isSet(object.lossPct) - ? globalThis.Number(object.lossPct) - : isSet(object.loss_pct) - ? globalThis.Number(object.loss_pct) - : undefined, - seqNo: isSet(object.seqNo) - ? globalThis.Number(object.seqNo) - : isSet(object.seq_no) - ? globalThis.Number(object.seq_no) - : undefined, - audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, - }; + fromJSON(object: any): DeleteLookupMasterResponse { + return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; }, - toJSON(message: ProductGrade): unknown { + toJSON(message: DeleteLookupMasterResponse): unknown { const obj: any = {}; - if (message.pgId !== "") { - obj.pgId = message.pgId; - } - if (message.pgCode !== "") { - obj.pgCode = message.pgCode; - } - if (message.pgName !== "") { - obj.pgName = message.pgName; - } - if (message.pgDescription !== "") { - obj.pgDescription = message.pgDescription; - } - if (message.bcPerc !== 0) { - obj.bcPerc = message.bcPerc; - } - if (message.nonStdPerc !== 0) { - obj.nonStdPerc = message.nonStdPerc; - } - if (message.bcRecoveryRate !== 0) { - obj.bcRecoveryRate = message.bcRecoveryRate; - } - if (message.isActive !== false) { - obj.isActive = message.isActive; - } - if (message.notes !== "") { - obj.notes = message.notes; - } - if (message.pgDetailProduct !== "") { - obj.pgDetailProduct = message.pgDetailProduct; - } - if (message.pgGradeLabel !== "") { - obj.pgGradeLabel = message.pgGradeLabel; - } - if (message.stdSellingPrice !== 0) { - obj.stdSellingPrice = message.stdSellingPrice; - } - if (message.spValue !== 0) { - obj.spValue = message.spValue; - } - if (message.lossPct !== undefined) { - obj.lossPct = message.lossPct; - } - if (message.seqNo !== undefined) { - obj.seqNo = Math.round(message.seqNo); - } - if (message.audit !== undefined) { - obj.audit = AuditInfo.toJSON(message.audit); + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); } return obj; }, - create(base?: DeepPartial): ProductGrade { - return ProductGrade.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteLookupMasterResponse { + return DeleteLookupMasterResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ProductGrade { - const message = createBaseProductGrade(); - message.pgId = object.pgId ?? ""; - message.pgCode = object.pgCode ?? ""; - message.pgName = object.pgName ?? ""; - message.pgDescription = object.pgDescription ?? ""; - message.bcPerc = object.bcPerc ?? 0; - message.nonStdPerc = object.nonStdPerc ?? 0; - message.bcRecoveryRate = object.bcRecoveryRate ?? 0; - message.isActive = object.isActive ?? false; - message.notes = object.notes ?? ""; - message.pgDetailProduct = object.pgDetailProduct ?? ""; - message.pgGradeLabel = object.pgGradeLabel ?? ""; - message.stdSellingPrice = object.stdSellingPrice ?? 0; - message.spValue = object.spValue ?? 0; - message.lossPct = object.lossPct ?? undefined; - message.seqNo = object.seqNo ?? undefined; - message.audit = (object.audit !== undefined && object.audit !== null) - ? AuditInfo.fromPartial(object.audit) + fromPartial(object: DeepPartial): DeleteLookupMasterResponse { + const message = createBaseDeleteLookupMasterResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) : undefined; return message; }, }; -function createBaseCreateProductGradeRequest(): CreateProductGradeRequest { - return { - pgCode: "", - pgName: "", - pgDescription: "", - bcPerc: 0, - nonStdPerc: 0, - bcRecoveryRate: 0, - notes: "", - pgDetailProduct: "", - pgGradeLabel: "", - stdSellingPrice: 0, - spValue: 0, - lossPct: undefined, - seqNo: undefined, - }; +function createBaseCreateLookupMasterColumnRequest(): CreateLookupMasterColumnRequest { + return { lmcMasterCode: "", lmcColumnName: "", lmcDisplayName: "", lmcDataType: "", lmcSortOrder: 0 }; } -export const CreateProductGradeRequest: MessageFns = { - encode(message: CreateProductGradeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.pgCode !== "") { - writer.uint32(10).string(message.pgCode); - } - if (message.pgName !== "") { - writer.uint32(18).string(message.pgName); - } - if (message.pgDescription !== "") { - writer.uint32(26).string(message.pgDescription); - } - if (message.bcPerc !== 0) { - writer.uint32(33).double(message.bcPerc); - } - if (message.nonStdPerc !== 0) { - writer.uint32(41).double(message.nonStdPerc); - } - if (message.bcRecoveryRate !== 0) { - writer.uint32(49).double(message.bcRecoveryRate); - } - if (message.notes !== "") { - writer.uint32(58).string(message.notes); - } - if (message.pgDetailProduct !== "") { - writer.uint32(66).string(message.pgDetailProduct); - } - if (message.pgGradeLabel !== "") { - writer.uint32(74).string(message.pgGradeLabel); +export const CreateLookupMasterColumnRequest: MessageFns = { + encode(message: CreateLookupMasterColumnRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.lmcMasterCode !== "") { + writer.uint32(10).string(message.lmcMasterCode); } - if (message.stdSellingPrice !== 0) { - writer.uint32(81).double(message.stdSellingPrice); + if (message.lmcColumnName !== "") { + writer.uint32(18).string(message.lmcColumnName); } - if (message.spValue !== 0) { - writer.uint32(89).double(message.spValue); + if (message.lmcDisplayName !== "") { + writer.uint32(26).string(message.lmcDisplayName); } - if (message.lossPct !== undefined) { - writer.uint32(97).double(message.lossPct); + if (message.lmcDataType !== "") { + writer.uint32(34).string(message.lmcDataType); } - if (message.seqNo !== undefined) { - writer.uint32(104).int32(message.seqNo); + if (message.lmcSortOrder !== 0) { + writer.uint32(40).int32(message.lmcSortOrder); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateProductGradeRequest { + decode(input: BinaryReader | Uint8Array, length?: number): CreateLookupMasterColumnRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateProductGradeRequest(); + const message = createBaseCreateLookupMasterColumnRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -10223,7 +20358,7 @@ export const CreateProductGradeRequest: MessageFns = break; } - message.pgCode = reader.string(); + message.lmcMasterCode = reader.string(); continue; } case 2: { @@ -10231,7 +20366,7 @@ export const CreateProductGradeRequest: MessageFns = break; } - message.pgName = reader.string(); + message.lmcColumnName = reader.string(); continue; } case 3: { @@ -10239,87 +20374,23 @@ export const CreateProductGradeRequest: MessageFns = break; } - message.pgDescription = reader.string(); + message.lmcDisplayName = reader.string(); continue; } case 4: { - if (tag !== 33) { + if (tag !== 34) { break; } - message.bcPerc = reader.double(); + message.lmcDataType = reader.string(); continue; } case 5: { - if (tag !== 41) { - break; - } - - message.nonStdPerc = reader.double(); - continue; - } - case 6: { - if (tag !== 49) { - break; - } - - message.bcRecoveryRate = reader.double(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.notes = reader.string(); - continue; - } - case 8: { - if (tag !== 66) { - break; - } - - message.pgDetailProduct = reader.string(); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.pgGradeLabel = reader.string(); - continue; - } - case 10: { - if (tag !== 81) { - break; - } - - message.stdSellingPrice = reader.double(); - continue; - } - case 11: { - if (tag !== 89) { - break; - } - - message.spValue = reader.double(); - continue; - } - case 12: { - if (tag !== 97) { - break; - } - - message.lossPct = reader.double(); - continue; - } - case 13: { - if (tag !== 104) { + if (tag !== 40) { break; } - message.seqNo = reader.int32(); + message.lmcSortOrder = reader.int32(); continue; } } @@ -10331,157 +20402,89 @@ export const CreateProductGradeRequest: MessageFns = return message; }, - fromJSON(object: any): CreateProductGradeRequest { + fromJSON(object: any): CreateLookupMasterColumnRequest { return { - pgCode: isSet(object.pgCode) - ? globalThis.String(object.pgCode) - : isSet(object.pg_code) - ? globalThis.String(object.pg_code) - : "", - pgName: isSet(object.pgName) - ? globalThis.String(object.pgName) - : isSet(object.pg_name) - ? globalThis.String(object.pg_name) + lmcMasterCode: isSet(object.lmcMasterCode) + ? globalThis.String(object.lmcMasterCode) + : isSet(object.lmc_master_code) + ? globalThis.String(object.lmc_master_code) : "", - pgDescription: isSet(object.pgDescription) - ? globalThis.String(object.pgDescription) - : isSet(object.pg_description) - ? globalThis.String(object.pg_description) + lmcColumnName: isSet(object.lmcColumnName) + ? globalThis.String(object.lmcColumnName) + : isSet(object.lmc_column_name) + ? globalThis.String(object.lmc_column_name) : "", - bcPerc: isSet(object.bcPerc) - ? globalThis.Number(object.bcPerc) - : isSet(object.bc_perc) - ? globalThis.Number(object.bc_perc) - : 0, - nonStdPerc: isSet(object.nonStdPerc) - ? globalThis.Number(object.nonStdPerc) - : isSet(object.non_std_perc) - ? globalThis.Number(object.non_std_perc) - : 0, - bcRecoveryRate: isSet(object.bcRecoveryRate) - ? globalThis.Number(object.bcRecoveryRate) - : isSet(object.bc_recovery_rate) - ? globalThis.Number(object.bc_recovery_rate) - : 0, - notes: isSet(object.notes) ? globalThis.String(object.notes) : "", - pgDetailProduct: isSet(object.pgDetailProduct) - ? globalThis.String(object.pgDetailProduct) - : isSet(object.pg_detail_product) - ? globalThis.String(object.pg_detail_product) + lmcDisplayName: isSet(object.lmcDisplayName) + ? globalThis.String(object.lmcDisplayName) + : isSet(object.lmc_display_name) + ? globalThis.String(object.lmc_display_name) : "", - pgGradeLabel: isSet(object.pgGradeLabel) - ? globalThis.String(object.pgGradeLabel) - : isSet(object.pg_grade_label) - ? globalThis.String(object.pg_grade_label) + lmcDataType: isSet(object.lmcDataType) + ? globalThis.String(object.lmcDataType) + : isSet(object.lmc_data_type) + ? globalThis.String(object.lmc_data_type) : "", - stdSellingPrice: isSet(object.stdSellingPrice) - ? globalThis.Number(object.stdSellingPrice) - : isSet(object.std_selling_price) - ? globalThis.Number(object.std_selling_price) - : 0, - spValue: isSet(object.spValue) - ? globalThis.Number(object.spValue) - : isSet(object.sp_value) - ? globalThis.Number(object.sp_value) + lmcSortOrder: isSet(object.lmcSortOrder) + ? globalThis.Number(object.lmcSortOrder) + : isSet(object.lmc_sort_order) + ? globalThis.Number(object.lmc_sort_order) : 0, - lossPct: isSet(object.lossPct) - ? globalThis.Number(object.lossPct) - : isSet(object.loss_pct) - ? globalThis.Number(object.loss_pct) - : undefined, - seqNo: isSet(object.seqNo) - ? globalThis.Number(object.seqNo) - : isSet(object.seq_no) - ? globalThis.Number(object.seq_no) - : undefined, }; }, - toJSON(message: CreateProductGradeRequest): unknown { + toJSON(message: CreateLookupMasterColumnRequest): unknown { const obj: any = {}; - if (message.pgCode !== "") { - obj.pgCode = message.pgCode; - } - if (message.pgName !== "") { - obj.pgName = message.pgName; - } - if (message.pgDescription !== "") { - obj.pgDescription = message.pgDescription; - } - if (message.bcPerc !== 0) { - obj.bcPerc = message.bcPerc; - } - if (message.nonStdPerc !== 0) { - obj.nonStdPerc = message.nonStdPerc; - } - if (message.bcRecoveryRate !== 0) { - obj.bcRecoveryRate = message.bcRecoveryRate; - } - if (message.notes !== "") { - obj.notes = message.notes; - } - if (message.pgDetailProduct !== "") { - obj.pgDetailProduct = message.pgDetailProduct; - } - if (message.pgGradeLabel !== "") { - obj.pgGradeLabel = message.pgGradeLabel; + if (message.lmcMasterCode !== "") { + obj.lmcMasterCode = message.lmcMasterCode; } - if (message.stdSellingPrice !== 0) { - obj.stdSellingPrice = message.stdSellingPrice; + if (message.lmcColumnName !== "") { + obj.lmcColumnName = message.lmcColumnName; } - if (message.spValue !== 0) { - obj.spValue = message.spValue; + if (message.lmcDisplayName !== "") { + obj.lmcDisplayName = message.lmcDisplayName; } - if (message.lossPct !== undefined) { - obj.lossPct = message.lossPct; + if (message.lmcDataType !== "") { + obj.lmcDataType = message.lmcDataType; } - if (message.seqNo !== undefined) { - obj.seqNo = Math.round(message.seqNo); + if (message.lmcSortOrder !== 0) { + obj.lmcSortOrder = Math.round(message.lmcSortOrder); } return obj; }, - create(base?: DeepPartial): CreateProductGradeRequest { - return CreateProductGradeRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateLookupMasterColumnRequest { + return CreateLookupMasterColumnRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateProductGradeRequest { - const message = createBaseCreateProductGradeRequest(); - message.pgCode = object.pgCode ?? ""; - message.pgName = object.pgName ?? ""; - message.pgDescription = object.pgDescription ?? ""; - message.bcPerc = object.bcPerc ?? 0; - message.nonStdPerc = object.nonStdPerc ?? 0; - message.bcRecoveryRate = object.bcRecoveryRate ?? 0; - message.notes = object.notes ?? ""; - message.pgDetailProduct = object.pgDetailProduct ?? ""; - message.pgGradeLabel = object.pgGradeLabel ?? ""; - message.stdSellingPrice = object.stdSellingPrice ?? 0; - message.spValue = object.spValue ?? 0; - message.lossPct = object.lossPct ?? undefined; - message.seqNo = object.seqNo ?? undefined; + fromPartial(object: DeepPartial): CreateLookupMasterColumnRequest { + const message = createBaseCreateLookupMasterColumnRequest(); + message.lmcMasterCode = object.lmcMasterCode ?? ""; + message.lmcColumnName = object.lmcColumnName ?? ""; + message.lmcDisplayName = object.lmcDisplayName ?? ""; + message.lmcDataType = object.lmcDataType ?? ""; + message.lmcSortOrder = object.lmcSortOrder ?? 0; return message; }, }; -function createBaseCreateProductGradeResponse(): CreateProductGradeResponse { +function createBaseCreateLookupMasterColumnResponse(): CreateLookupMasterColumnResponse { return { base: undefined, data: undefined }; } -export const CreateProductGradeResponse: MessageFns = { - encode(message: CreateProductGradeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const CreateLookupMasterColumnResponse: MessageFns = { + encode(message: CreateLookupMasterColumnResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } if (message.data !== undefined) { - ProductGrade.encode(message.data, writer.uint32(18).fork()).join(); + LookupMasterColumn.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateProductGradeResponse { + decode(input: BinaryReader | Uint8Array, length?: number): CreateLookupMasterColumnResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateProductGradeResponse(); + const message = createBaseCreateLookupMasterColumnResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -10498,7 +20501,7 @@ export const CreateProductGradeResponse: MessageFns break; } - message.data = ProductGrade.decode(reader, reader.uint32()); + message.data = LookupMasterColumn.decode(reader, reader.uint32()); continue; } } @@ -10510,55 +20513,55 @@ export const CreateProductGradeResponse: MessageFns return message; }, - fromJSON(object: any): CreateProductGradeResponse { + fromJSON(object: any): CreateLookupMasterColumnResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? ProductGrade.fromJSON(object.data) : undefined, + data: isSet(object.data) ? LookupMasterColumn.fromJSON(object.data) : undefined, }; }, - toJSON(message: CreateProductGradeResponse): unknown { + toJSON(message: CreateLookupMasterColumnResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data !== undefined) { - obj.data = ProductGrade.toJSON(message.data); + obj.data = LookupMasterColumn.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): CreateProductGradeResponse { - return CreateProductGradeResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateLookupMasterColumnResponse { + return CreateLookupMasterColumnResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateProductGradeResponse { - const message = createBaseCreateProductGradeResponse(); + fromPartial(object: DeepPartial): CreateLookupMasterColumnResponse { + const message = createBaseCreateLookupMasterColumnResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; message.data = (object.data !== undefined && object.data !== null) - ? ProductGrade.fromPartial(object.data) + ? LookupMasterColumn.fromPartial(object.data) : undefined; return message; }, }; -function createBaseGetProductGradeRequest(): GetProductGradeRequest { - return { pgId: "" }; +function createBaseDeleteLookupMasterColumnRequest(): DeleteLookupMasterColumnRequest { + return { lmcId: "" }; } -export const GetProductGradeRequest: MessageFns = { - encode(message: GetProductGradeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.pgId !== "") { - writer.uint32(10).string(message.pgId); +export const DeleteLookupMasterColumnRequest: MessageFns = { + encode(message: DeleteLookupMasterColumnRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.lmcId !== "") { + writer.uint32(10).string(message.lmcId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetProductGradeRequest { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteLookupMasterColumnRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetProductGradeRequest(); + const message = createBaseDeleteLookupMasterColumnRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -10567,7 +20570,7 @@ export const GetProductGradeRequest: MessageFns = { break; } - message.pgId = reader.string(); + message.lmcId = reader.string(); continue; } } @@ -10579,53 +20582,50 @@ export const GetProductGradeRequest: MessageFns = { return message; }, - fromJSON(object: any): GetProductGradeRequest { + fromJSON(object: any): DeleteLookupMasterColumnRequest { return { - pgId: isSet(object.pgId) - ? globalThis.String(object.pgId) - : isSet(object.pg_id) - ? globalThis.String(object.pg_id) + lmcId: isSet(object.lmcId) + ? globalThis.String(object.lmcId) + : isSet(object.lmc_id) + ? globalThis.String(object.lmc_id) : "", }; }, - toJSON(message: GetProductGradeRequest): unknown { + toJSON(message: DeleteLookupMasterColumnRequest): unknown { const obj: any = {}; - if (message.pgId !== "") { - obj.pgId = message.pgId; + if (message.lmcId !== "") { + obj.lmcId = message.lmcId; } return obj; }, - create(base?: DeepPartial): GetProductGradeRequest { - return GetProductGradeRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteLookupMasterColumnRequest { + return DeleteLookupMasterColumnRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetProductGradeRequest { - const message = createBaseGetProductGradeRequest(); - message.pgId = object.pgId ?? ""; + fromPartial(object: DeepPartial): DeleteLookupMasterColumnRequest { + const message = createBaseDeleteLookupMasterColumnRequest(); + message.lmcId = object.lmcId ?? ""; return message; }, }; -function createBaseGetProductGradeResponse(): GetProductGradeResponse { - return { base: undefined, data: undefined }; +function createBaseDeleteLookupMasterColumnResponse(): DeleteLookupMasterColumnResponse { + return { base: undefined }; } -export const GetProductGradeResponse: MessageFns = { - encode(message: GetProductGradeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DeleteLookupMasterColumnResponse: MessageFns = { + encode(message: DeleteLookupMasterColumnResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.data !== undefined) { - ProductGrade.encode(message.data, writer.uint32(18).fork()).join(); - } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetProductGradeResponse { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteLookupMasterColumnResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetProductGradeResponse(); + const message = createBaseDeleteLookupMasterColumnResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -10637,14 +20637,6 @@ export const GetProductGradeResponse: MessageFns = { message.base = BaseResponse.decode(reader, reader.uint32()); continue; } - case 2: { - if (tag !== 18) { - break; - } - - message.data = ProductGrade.decode(reader, reader.uint32()); - continue; - } } if ((tag & 7) === 4 || tag === 0) { break; @@ -10654,222 +20646,88 @@ export const GetProductGradeResponse: MessageFns = { return message; }, - fromJSON(object: any): GetProductGradeResponse { - return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? ProductGrade.fromJSON(object.data) : undefined, - }; + fromJSON(object: any): DeleteLookupMasterColumnResponse { + return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; }, - toJSON(message: GetProductGradeResponse): unknown { + toJSON(message: DeleteLookupMasterColumnResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data !== undefined) { - obj.data = ProductGrade.toJSON(message.data); - } return obj; }, - create(base?: DeepPartial): GetProductGradeResponse { - return GetProductGradeResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteLookupMasterColumnResponse { + return DeleteLookupMasterColumnResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetProductGradeResponse { - const message = createBaseGetProductGradeResponse(); + fromPartial(object: DeepPartial): DeleteLookupMasterColumnResponse { + const message = createBaseDeleteLookupMasterColumnResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? ProductGrade.fromPartial(object.data) - : undefined; return message; }, }; -function createBaseUpdateProductGradeRequest(): UpdateProductGradeRequest { - return { - pgId: "", - pgName: undefined, - pgDescription: undefined, - bcPerc: undefined, - nonStdPerc: undefined, - bcRecoveryRate: undefined, - notes: undefined, - isActive: undefined, - pgDetailProduct: undefined, - pgGradeLabel: undefined, - stdSellingPrice: undefined, - spValue: undefined, - lossPct: undefined, - seqNo: undefined, - }; +function createBaseUpdateLookupMasterRequest(): UpdateLookupMasterRequest { + return { lmCode: "", lmDisplayName: undefined, lmTableName: undefined, lmIsActive: undefined }; } -export const UpdateProductGradeRequest: MessageFns = { - encode(message: UpdateProductGradeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.pgId !== "") { - writer.uint32(10).string(message.pgId); - } - if (message.pgName !== undefined) { - writer.uint32(18).string(message.pgName); - } - if (message.pgDescription !== undefined) { - writer.uint32(26).string(message.pgDescription); - } - if (message.bcPerc !== undefined) { - writer.uint32(33).double(message.bcPerc); - } - if (message.nonStdPerc !== undefined) { - writer.uint32(41).double(message.nonStdPerc); - } - if (message.bcRecoveryRate !== undefined) { - writer.uint32(49).double(message.bcRecoveryRate); - } - if (message.notes !== undefined) { - writer.uint32(58).string(message.notes); - } - if (message.isActive !== undefined) { - writer.uint32(64).bool(message.isActive); - } - if (message.pgDetailProduct !== undefined) { - writer.uint32(74).string(message.pgDetailProduct); - } - if (message.pgGradeLabel !== undefined) { - writer.uint32(82).string(message.pgGradeLabel); - } - if (message.stdSellingPrice !== undefined) { - writer.uint32(89).double(message.stdSellingPrice); - } - if (message.spValue !== undefined) { - writer.uint32(97).double(message.spValue); +export const UpdateLookupMasterRequest: MessageFns = { + encode(message: UpdateLookupMasterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.lmCode !== "") { + writer.uint32(10).string(message.lmCode); } - if (message.lossPct !== undefined) { - writer.uint32(105).double(message.lossPct); + if (message.lmDisplayName !== undefined) { + writer.uint32(18).string(message.lmDisplayName); } - if (message.seqNo !== undefined) { - writer.uint32(112).int32(message.seqNo); + if (message.lmTableName !== undefined) { + writer.uint32(26).string(message.lmTableName); } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): UpdateProductGradeRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateProductGradeRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.pgId = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.pgName = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.pgDescription = reader.string(); - continue; - } - case 4: { - if (tag !== 33) { - break; - } - - message.bcPerc = reader.double(); - continue; - } - case 5: { - if (tag !== 41) { - break; - } - - message.nonStdPerc = reader.double(); - continue; - } - case 6: { - if (tag !== 49) { - break; - } - - message.bcRecoveryRate = reader.double(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.notes = reader.string(); - continue; - } - case 8: { - if (tag !== 64) { - break; - } - - message.isActive = reader.bool(); - continue; - } - case 9: { - if (tag !== 74) { - break; - } - - message.pgDetailProduct = reader.string(); - continue; - } - case 10: { - if (tag !== 82) { - break; - } + if (message.lmIsActive !== undefined) { + writer.uint32(32).bool(message.lmIsActive); + } + return writer; + }, - message.pgGradeLabel = reader.string(); - continue; - } - case 11: { - if (tag !== 89) { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateLookupMasterRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateLookupMasterRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { break; } - message.stdSellingPrice = reader.double(); + message.lmCode = reader.string(); continue; } - case 12: { - if (tag !== 97) { + case 2: { + if (tag !== 18) { break; } - message.spValue = reader.double(); + message.lmDisplayName = reader.string(); continue; } - case 13: { - if (tag !== 105) { + case 3: { + if (tag !== 26) { break; } - message.lossPct = reader.double(); + message.lmTableName = reader.string(); continue; } - case 14: { - if (tag !== 112) { + case 4: { + if (tag !== 32) { break; } - message.seqNo = reader.int32(); + message.lmIsActive = reader.bool(); continue; } } @@ -10881,166 +20739,166 @@ export const UpdateProductGradeRequest: MessageFns = return message; }, - fromJSON(object: any): UpdateProductGradeRequest { + fromJSON(object: any): UpdateLookupMasterRequest { return { - pgId: isSet(object.pgId) - ? globalThis.String(object.pgId) - : isSet(object.pg_id) - ? globalThis.String(object.pg_id) + lmCode: isSet(object.lmCode) + ? globalThis.String(object.lmCode) + : isSet(object.lm_code) + ? globalThis.String(object.lm_code) : "", - pgName: isSet(object.pgName) - ? globalThis.String(object.pgName) - : isSet(object.pg_name) - ? globalThis.String(object.pg_name) - : undefined, - pgDescription: isSet(object.pgDescription) - ? globalThis.String(object.pgDescription) - : isSet(object.pg_description) - ? globalThis.String(object.pg_description) - : undefined, - bcPerc: isSet(object.bcPerc) - ? globalThis.Number(object.bcPerc) - : isSet(object.bc_perc) - ? globalThis.Number(object.bc_perc) - : undefined, - nonStdPerc: isSet(object.nonStdPerc) - ? globalThis.Number(object.nonStdPerc) - : isSet(object.non_std_perc) - ? globalThis.Number(object.non_std_perc) - : undefined, - bcRecoveryRate: isSet(object.bcRecoveryRate) - ? globalThis.Number(object.bcRecoveryRate) - : isSet(object.bc_recovery_rate) - ? globalThis.Number(object.bc_recovery_rate) - : undefined, - notes: isSet(object.notes) ? globalThis.String(object.notes) : undefined, - isActive: isSet(object.isActive) - ? globalThis.Boolean(object.isActive) - : isSet(object.is_active) - ? globalThis.Boolean(object.is_active) - : undefined, - pgDetailProduct: isSet(object.pgDetailProduct) - ? globalThis.String(object.pgDetailProduct) - : isSet(object.pg_detail_product) - ? globalThis.String(object.pg_detail_product) - : undefined, - pgGradeLabel: isSet(object.pgGradeLabel) - ? globalThis.String(object.pgGradeLabel) - : isSet(object.pg_grade_label) - ? globalThis.String(object.pg_grade_label) - : undefined, - stdSellingPrice: isSet(object.stdSellingPrice) - ? globalThis.Number(object.stdSellingPrice) - : isSet(object.std_selling_price) - ? globalThis.Number(object.std_selling_price) - : undefined, - spValue: isSet(object.spValue) - ? globalThis.Number(object.spValue) - : isSet(object.sp_value) - ? globalThis.Number(object.sp_value) + lmDisplayName: isSet(object.lmDisplayName) + ? globalThis.String(object.lmDisplayName) + : isSet(object.lm_display_name) + ? globalThis.String(object.lm_display_name) : undefined, - lossPct: isSet(object.lossPct) - ? globalThis.Number(object.lossPct) - : isSet(object.loss_pct) - ? globalThis.Number(object.loss_pct) + lmTableName: isSet(object.lmTableName) + ? globalThis.String(object.lmTableName) + : isSet(object.lm_table_name) + ? globalThis.String(object.lm_table_name) : undefined, - seqNo: isSet(object.seqNo) - ? globalThis.Number(object.seqNo) - : isSet(object.seq_no) - ? globalThis.Number(object.seq_no) + lmIsActive: isSet(object.lmIsActive) + ? globalThis.Boolean(object.lmIsActive) + : isSet(object.lm_is_active) + ? globalThis.Boolean(object.lm_is_active) : undefined, }; }, - toJSON(message: UpdateProductGradeRequest): unknown { + toJSON(message: UpdateLookupMasterRequest): unknown { const obj: any = {}; - if (message.pgId !== "") { - obj.pgId = message.pgId; - } - if (message.pgName !== undefined) { - obj.pgName = message.pgName; - } - if (message.pgDescription !== undefined) { - obj.pgDescription = message.pgDescription; - } - if (message.bcPerc !== undefined) { - obj.bcPerc = message.bcPerc; - } - if (message.nonStdPerc !== undefined) { - obj.nonStdPerc = message.nonStdPerc; - } - if (message.bcRecoveryRate !== undefined) { - obj.bcRecoveryRate = message.bcRecoveryRate; + if (message.lmCode !== "") { + obj.lmCode = message.lmCode; } - if (message.notes !== undefined) { - obj.notes = message.notes; + if (message.lmDisplayName !== undefined) { + obj.lmDisplayName = message.lmDisplayName; } - if (message.isActive !== undefined) { - obj.isActive = message.isActive; + if (message.lmTableName !== undefined) { + obj.lmTableName = message.lmTableName; } - if (message.pgDetailProduct !== undefined) { - obj.pgDetailProduct = message.pgDetailProduct; + if (message.lmIsActive !== undefined) { + obj.lmIsActive = message.lmIsActive; } - if (message.pgGradeLabel !== undefined) { - obj.pgGradeLabel = message.pgGradeLabel; + return obj; + }, + + create(base?: DeepPartial): UpdateLookupMasterRequest { + return UpdateLookupMasterRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateLookupMasterRequest { + const message = createBaseUpdateLookupMasterRequest(); + message.lmCode = object.lmCode ?? ""; + message.lmDisplayName = object.lmDisplayName ?? undefined; + message.lmTableName = object.lmTableName ?? undefined; + message.lmIsActive = object.lmIsActive ?? undefined; + return message; + }, +}; + +function createBaseUpdateLookupMasterResponse(): UpdateLookupMasterResponse { + return { base: undefined, data: undefined }; +} + +export const UpdateLookupMasterResponse: MessageFns = { + encode(message: UpdateLookupMasterResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.stdSellingPrice !== undefined) { - obj.stdSellingPrice = message.stdSellingPrice; + if (message.data !== undefined) { + LookupMaster.encode(message.data, writer.uint32(18).fork()).join(); } - if (message.spValue !== undefined) { - obj.spValue = message.spValue; + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateLookupMasterResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateLookupMasterResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = LookupMaster.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } - if (message.lossPct !== undefined) { - obj.lossPct = message.lossPct; + return message; + }, + + fromJSON(object: any): UpdateLookupMasterResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? LookupMaster.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: UpdateLookupMasterResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); } - if (message.seqNo !== undefined) { - obj.seqNo = Math.round(message.seqNo); + if (message.data !== undefined) { + obj.data = LookupMaster.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): UpdateProductGradeRequest { - return UpdateProductGradeRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateLookupMasterResponse { + return UpdateLookupMasterResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateProductGradeRequest { - const message = createBaseUpdateProductGradeRequest(); - message.pgId = object.pgId ?? ""; - message.pgName = object.pgName ?? undefined; - message.pgDescription = object.pgDescription ?? undefined; - message.bcPerc = object.bcPerc ?? undefined; - message.nonStdPerc = object.nonStdPerc ?? undefined; - message.bcRecoveryRate = object.bcRecoveryRate ?? undefined; - message.notes = object.notes ?? undefined; - message.isActive = object.isActive ?? undefined; - message.pgDetailProduct = object.pgDetailProduct ?? undefined; - message.pgGradeLabel = object.pgGradeLabel ?? undefined; - message.stdSellingPrice = object.stdSellingPrice ?? undefined; - message.spValue = object.spValue ?? undefined; - message.lossPct = object.lossPct ?? undefined; - message.seqNo = object.seqNo ?? undefined; + fromPartial(object: DeepPartial): UpdateLookupMasterResponse { + const message = createBaseUpdateLookupMasterResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? LookupMaster.fromPartial(object.data) + : undefined; return message; }, }; -function createBaseUpdateProductGradeResponse(): UpdateProductGradeResponse { - return { base: undefined, data: undefined }; +function createBaseTableColumn(): TableColumn { + return { columnName: "", dataType: "", rawType: "", ordinalPosition: 0 }; } -export const UpdateProductGradeResponse: MessageFns = { - encode(message: UpdateProductGradeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); +export const TableColumn: MessageFns = { + encode(message: TableColumn, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.columnName !== "") { + writer.uint32(10).string(message.columnName); } - if (message.data !== undefined) { - ProductGrade.encode(message.data, writer.uint32(18).fork()).join(); + if (message.dataType !== "") { + writer.uint32(18).string(message.dataType); + } + if (message.rawType !== "") { + writer.uint32(26).string(message.rawType); + } + if (message.ordinalPosition !== 0) { + writer.uint32(32).int32(message.ordinalPosition); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateProductGradeResponse { + decode(input: BinaryReader | Uint8Array, length?: number): TableColumn { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateProductGradeResponse(); + const message = createBaseTableColumn(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -11049,7 +20907,7 @@ export const UpdateProductGradeResponse: MessageFns break; } - message.base = BaseResponse.decode(reader, reader.uint32()); + message.columnName = reader.string(); continue; } case 2: { @@ -11057,7 +20915,23 @@ export const UpdateProductGradeResponse: MessageFns break; } - message.data = ProductGrade.decode(reader, reader.uint32()); + message.dataType = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.rawType = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.ordinalPosition = reader.int32(); continue; } } @@ -11069,55 +20943,77 @@ export const UpdateProductGradeResponse: MessageFns return message; }, - fromJSON(object: any): UpdateProductGradeResponse { + fromJSON(object: any): TableColumn { return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? ProductGrade.fromJSON(object.data) : undefined, + columnName: isSet(object.columnName) + ? globalThis.String(object.columnName) + : isSet(object.column_name) + ? globalThis.String(object.column_name) + : "", + dataType: isSet(object.dataType) + ? globalThis.String(object.dataType) + : isSet(object.data_type) + ? globalThis.String(object.data_type) + : "", + rawType: isSet(object.rawType) + ? globalThis.String(object.rawType) + : isSet(object.raw_type) + ? globalThis.String(object.raw_type) + : "", + ordinalPosition: isSet(object.ordinalPosition) + ? globalThis.Number(object.ordinalPosition) + : isSet(object.ordinal_position) + ? globalThis.Number(object.ordinal_position) + : 0, }; }, - toJSON(message: UpdateProductGradeResponse): unknown { + toJSON(message: TableColumn): unknown { const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); + if (message.columnName !== "") { + obj.columnName = message.columnName; } - if (message.data !== undefined) { - obj.data = ProductGrade.toJSON(message.data); + if (message.dataType !== "") { + obj.dataType = message.dataType; + } + if (message.rawType !== "") { + obj.rawType = message.rawType; + } + if (message.ordinalPosition !== 0) { + obj.ordinalPosition = Math.round(message.ordinalPosition); } return obj; }, - create(base?: DeepPartial): UpdateProductGradeResponse { - return UpdateProductGradeResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): TableColumn { + return TableColumn.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateProductGradeResponse { - const message = createBaseUpdateProductGradeResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? ProductGrade.fromPartial(object.data) - : undefined; + fromPartial(object: DeepPartial): TableColumn { + const message = createBaseTableColumn(); + message.columnName = object.columnName ?? ""; + message.dataType = object.dataType ?? ""; + message.rawType = object.rawType ?? ""; + message.ordinalPosition = object.ordinalPosition ?? 0; return message; }, }; -function createBaseDeleteProductGradeRequest(): DeleteProductGradeRequest { - return { pgId: "" }; +function createBaseListTableColumnsRequest(): ListTableColumnsRequest { + return { tableName: "" }; } -export const DeleteProductGradeRequest: MessageFns = { - encode(message: DeleteProductGradeRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.pgId !== "") { - writer.uint32(10).string(message.pgId); +export const ListTableColumnsRequest: MessageFns = { + encode(message: ListTableColumnsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.tableName !== "") { + writer.uint32(10).string(message.tableName); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteProductGradeRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ListTableColumnsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteProductGradeRequest(); + const message = createBaseListTableColumnsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -11126,7 +21022,7 @@ export const DeleteProductGradeRequest: MessageFns = break; } - message.pgId = reader.string(); + message.tableName = reader.string(); continue; } } @@ -11138,50 +21034,131 @@ export const DeleteProductGradeRequest: MessageFns = return message; }, - fromJSON(object: any): DeleteProductGradeRequest { + fromJSON(object: any): ListTableColumnsRequest { return { - pgId: isSet(object.pgId) - ? globalThis.String(object.pgId) - : isSet(object.pg_id) - ? globalThis.String(object.pg_id) + tableName: isSet(object.tableName) + ? globalThis.String(object.tableName) + : isSet(object.table_name) + ? globalThis.String(object.table_name) : "", }; }, - toJSON(message: DeleteProductGradeRequest): unknown { + toJSON(message: ListTableColumnsRequest): unknown { const obj: any = {}; - if (message.pgId !== "") { - obj.pgId = message.pgId; + if (message.tableName !== "") { + obj.tableName = message.tableName; } return obj; }, - create(base?: DeepPartial): DeleteProductGradeRequest { - return DeleteProductGradeRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ListTableColumnsRequest { + return ListTableColumnsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteProductGradeRequest { - const message = createBaseDeleteProductGradeRequest(); - message.pgId = object.pgId ?? ""; + fromPartial(object: DeepPartial): ListTableColumnsRequest { + const message = createBaseListTableColumnsRequest(); + message.tableName = object.tableName ?? ""; return message; }, }; -function createBaseDeleteProductGradeResponse(): DeleteProductGradeResponse { - return { base: undefined }; +function createBaseListTableColumnsResponse(): ListTableColumnsResponse { + return { base: undefined, data: [] }; } -export const DeleteProductGradeResponse: MessageFns = { - encode(message: DeleteProductGradeResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListTableColumnsResponse: MessageFns = { + encode(message: ListTableColumnsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } + for (const v of message.data) { + TableColumn.encode(v!, writer.uint32(18).fork()).join(); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteProductGradeResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListTableColumnsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteProductGradeResponse(); + const message = createBaseListTableColumnsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data.push(TableColumn.decode(reader, reader.uint32())); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListTableColumnsResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => TableColumn.fromJSON(e)) : [], + }; + }, + + toJSON(message: ListTableColumnsResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data?.length) { + obj.data = message.data.map((e) => TableColumn.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ListTableColumnsResponse { + return ListTableColumnsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListTableColumnsResponse { + const message = createBaseListTableColumnsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = object.data?.map((e) => TableColumn.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseMasterOption(): MasterOption { + return { value: "", label: "" }; +} + +export const MasterOption: MessageFns = { + encode(message: MasterOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.value !== "") { + writer.uint32(10).string(message.value); + } + if (message.label !== "") { + writer.uint32(18).string(message.label); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): MasterOption { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMasterOption(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -11190,7 +21167,15 @@ export const DeleteProductGradeResponse: MessageFns break; } - message.base = BaseResponse.decode(reader, reader.uint32()); + message.value = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.label = reader.string(); continue; } } @@ -11202,110 +21187,60 @@ export const DeleteProductGradeResponse: MessageFns return message; }, - fromJSON(object: any): DeleteProductGradeResponse { - return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; + fromJSON(object: any): MasterOption { + return { + value: isSet(object.value) ? globalThis.String(object.value) : "", + label: isSet(object.label) ? globalThis.String(object.label) : "", + }; }, - toJSON(message: DeleteProductGradeResponse): unknown { + toJSON(message: MasterOption): unknown { const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); + if (message.value !== "") { + obj.value = message.value; + } + if (message.label !== "") { + obj.label = message.label; } return obj; }, - create(base?: DeepPartial): DeleteProductGradeResponse { - return DeleteProductGradeResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): MasterOption { + return MasterOption.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteProductGradeResponse { - const message = createBaseDeleteProductGradeResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; + fromPartial(object: DeepPartial): MasterOption { + const message = createBaseMasterOption(); + message.value = object.value ?? ""; + message.label = object.label ?? ""; return message; }, }; -function createBaseListProductGradesRequest(): ListProductGradesRequest { - return { page: 0, pageSize: 0, search: "", activeFilter: 0, sortBy: "", sortOrder: "" }; +function createBaseListMasterOptionsRequest(): ListMasterOptionsRequest { + return { masterCode: "" }; } -export const ListProductGradesRequest: MessageFns = { - encode(message: ListProductGradesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.page !== 0) { - writer.uint32(8).int32(message.page); - } - if (message.pageSize !== 0) { - writer.uint32(16).int32(message.pageSize); - } - if (message.search !== "") { - writer.uint32(26).string(message.search); - } - if (message.activeFilter !== 0) { - writer.uint32(32).int32(message.activeFilter); - } - if (message.sortBy !== "") { - writer.uint32(42).string(message.sortBy); - } - if (message.sortOrder !== "") { - writer.uint32(50).string(message.sortOrder); +export const ListMasterOptionsRequest: MessageFns = { + encode(message: ListMasterOptionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.masterCode !== "") { + writer.uint32(10).string(message.masterCode); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListProductGradesRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ListMasterOptionsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListProductGradesRequest(); + const message = createBaseListMasterOptionsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 8) { - break; - } - - message.page = reader.int32(); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.pageSize = reader.int32(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.search = reader.string(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.activeFilter = reader.int32() as any; - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.sortBy = reader.string(); - continue; - } - case 6: { - if (tag !== 50) { + if (tag !== 10) { break; } - message.sortOrder = reader.string(); + message.masterCode = reader.string(); continue; } } @@ -11317,93 +21252,53 @@ export const ListProductGradesRequest: MessageFns = { return message; }, - fromJSON(object: any): ListProductGradesRequest { + fromJSON(object: any): ListMasterOptionsRequest { return { - page: isSet(object.page) ? globalThis.Number(object.page) : 0, - pageSize: isSet(object.pageSize) - ? globalThis.Number(object.pageSize) - : isSet(object.page_size) - ? globalThis.Number(object.page_size) - : 0, - search: isSet(object.search) ? globalThis.String(object.search) : "", - activeFilter: isSet(object.activeFilter) - ? activeFilterFromJSON(object.activeFilter) - : isSet(object.active_filter) - ? activeFilterFromJSON(object.active_filter) - : 0, - sortBy: isSet(object.sortBy) - ? globalThis.String(object.sortBy) - : isSet(object.sort_by) - ? globalThis.String(object.sort_by) - : "", - sortOrder: isSet(object.sortOrder) - ? globalThis.String(object.sortOrder) - : isSet(object.sort_order) - ? globalThis.String(object.sort_order) + masterCode: isSet(object.masterCode) + ? globalThis.String(object.masterCode) + : isSet(object.master_code) + ? globalThis.String(object.master_code) : "", }; }, - toJSON(message: ListProductGradesRequest): unknown { + toJSON(message: ListMasterOptionsRequest): unknown { const obj: any = {}; - if (message.page !== 0) { - obj.page = Math.round(message.page); - } - if (message.pageSize !== 0) { - obj.pageSize = Math.round(message.pageSize); - } - if (message.search !== "") { - obj.search = message.search; - } - if (message.activeFilter !== 0) { - obj.activeFilter = activeFilterToJSON(message.activeFilter); - } - if (message.sortBy !== "") { - obj.sortBy = message.sortBy; - } - if (message.sortOrder !== "") { - obj.sortOrder = message.sortOrder; + if (message.masterCode !== "") { + obj.masterCode = message.masterCode; } return obj; }, - create(base?: DeepPartial): ListProductGradesRequest { - return ListProductGradesRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMasterOptionsRequest { + return ListMasterOptionsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListProductGradesRequest { - const message = createBaseListProductGradesRequest(); - message.page = object.page ?? 0; - message.pageSize = object.pageSize ?? 0; - message.search = object.search ?? ""; - message.activeFilter = object.activeFilter ?? 0; - message.sortBy = object.sortBy ?? ""; - message.sortOrder = object.sortOrder ?? ""; + fromPartial(object: DeepPartial): ListMasterOptionsRequest { + const message = createBaseListMasterOptionsRequest(); + message.masterCode = object.masterCode ?? ""; return message; }, }; -function createBaseListProductGradesResponse(): ListProductGradesResponse { - return { base: undefined, data: [], pagination: undefined }; +function createBaseListMasterOptionsResponse(): ListMasterOptionsResponse { + return { base: undefined, data: [] }; } -export const ListProductGradesResponse: MessageFns = { - encode(message: ListProductGradesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListMasterOptionsResponse: MessageFns = { + encode(message: ListMasterOptionsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } for (const v of message.data) { - ProductGrade.encode(v!, writer.uint32(18).fork()).join(); - } - if (message.pagination !== undefined) { - PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); + MasterOption.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListProductGradesResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListMasterOptionsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListProductGradesResponse(); + const message = createBaseListMasterOptionsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -11420,15 +21315,7 @@ export const ListProductGradesResponse: MessageFns = break; } - message.data.push(ProductGrade.decode(reader, reader.uint32())); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.pagination = PaginationResponse.decode(reader, reader.uint32()); + message.data.push(MasterOption.decode(reader, reader.uint32())); continue; } } @@ -11440,71 +21327,53 @@ export const ListProductGradesResponse: MessageFns = return message; }, - fromJSON(object: any): ListProductGradesResponse { + fromJSON(object: any): ListMasterOptionsResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => ProductGrade.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MasterOption.fromJSON(e)) : [], }; }, - toJSON(message: ListProductGradesResponse): unknown { + toJSON(message: ListMasterOptionsResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data?.length) { - obj.data = message.data.map((e) => ProductGrade.toJSON(e)); - } - if (message.pagination !== undefined) { - obj.pagination = PaginationResponse.toJSON(message.pagination); + obj.data = message.data.map((e) => MasterOption.toJSON(e)); } return obj; }, - create(base?: DeepPartial): ListProductGradesResponse { - return ListProductGradesResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMasterOptionsResponse { + return ListMasterOptionsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListProductGradesResponse { - const message = createBaseListProductGradesResponse(); + fromPartial(object: DeepPartial): ListMasterOptionsResponse { + const message = createBaseListMasterOptionsResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = object.data?.map((e) => ProductGrade.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PaginationResponse.fromPartial(object.pagination) - : undefined; + message.data = object.data?.map((e) => MasterOption.fromPartial(e)) || []; return message; }, }; -function createBaseExportProductGradesRequest(): ExportProductGradesRequest { - return { activeFilter: 0 }; +function createBaseExportLookupMastersRequest(): ExportLookupMastersRequest { + return {}; } -export const ExportProductGradesRequest: MessageFns = { - encode(message: ExportProductGradesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.activeFilter !== 0) { - writer.uint32(8).int32(message.activeFilter); - } +export const ExportLookupMastersRequest: MessageFns = { + encode(_: ExportLookupMastersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportProductGradesRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ExportLookupMastersRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportProductGradesRequest(); + const message = createBaseExportLookupMastersRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - if (tag !== 8) { - break; - } - - message.activeFilter = reader.int32() as any; - continue; - } } if ((tag & 7) === 4 || tag === 0) { break; @@ -11514,40 +21383,30 @@ export const ExportProductGradesRequest: MessageFns return message; }, - fromJSON(object: any): ExportProductGradesRequest { - return { - activeFilter: isSet(object.activeFilter) - ? activeFilterFromJSON(object.activeFilter) - : isSet(object.active_filter) - ? activeFilterFromJSON(object.active_filter) - : 0, - }; + fromJSON(_: any): ExportLookupMastersRequest { + return {}; }, - toJSON(message: ExportProductGradesRequest): unknown { + toJSON(_: ExportLookupMastersRequest): unknown { const obj: any = {}; - if (message.activeFilter !== 0) { - obj.activeFilter = activeFilterToJSON(message.activeFilter); - } return obj; }, - create(base?: DeepPartial): ExportProductGradesRequest { - return ExportProductGradesRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ExportLookupMastersRequest { + return ExportLookupMastersRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportProductGradesRequest { - const message = createBaseExportProductGradesRequest(); - message.activeFilter = object.activeFilter ?? 0; + fromPartial(_: DeepPartial): ExportLookupMastersRequest { + const message = createBaseExportLookupMastersRequest(); return message; }, }; -function createBaseExportProductGradesResponse(): ExportProductGradesResponse { +function createBaseExportLookupMastersResponse(): ExportLookupMastersResponse { return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; } -export const ExportProductGradesResponse: MessageFns = { - encode(message: ExportProductGradesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ExportLookupMastersResponse: MessageFns = { + encode(message: ExportLookupMastersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } @@ -11560,10 +21419,10 @@ export const ExportProductGradesResponse: MessageFns>> 3) { @@ -11600,7 +21459,7 @@ export const ExportProductGradesResponse: MessageFns): ExportProductGradesResponse { - return ExportProductGradesResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ExportLookupMastersResponse { + return ExportLookupMastersResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportProductGradesResponse { - const message = createBaseExportProductGradesResponse(); + fromPartial(object: DeepPartial): ExportLookupMastersResponse { + const message = createBaseExportLookupMastersResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; @@ -11644,28 +21503,25 @@ export const ExportProductGradesResponse: MessageFns = { - encode(message: ImportProductGradesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ImportLookupMastersRequest: MessageFns = { + encode(message: ImportLookupMastersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.fileContent.length !== 0) { writer.uint32(10).bytes(message.fileContent); } if (message.fileName !== "") { writer.uint32(18).string(message.fileName); } - if (message.duplicateAction !== "") { - writer.uint32(26).string(message.duplicateAction); - } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportProductGradesRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ImportLookupMastersRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportProductGradesRequest(); + const message = createBaseImportLookupMastersRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -11685,14 +21541,6 @@ export const ImportProductGradesRequest: MessageFns message.fileName = reader.string(); continue; } - case 3: { - if (tag !== 26) { - break; - } - - message.duplicateAction = reader.string(); - continue; - } } if ((tag & 7) === 4 || tag === 0) { break; @@ -11702,7 +21550,7 @@ export const ImportProductGradesRequest: MessageFns return message; }, - fromJSON(object: any): ImportProductGradesRequest { + fromJSON(object: any): ImportLookupMastersRequest { return { fileContent: isSet(object.fileContent) ? bytesFromBase64(object.fileContent) @@ -11714,15 +21562,10 @@ export const ImportProductGradesRequest: MessageFns : isSet(object.file_name) ? globalThis.String(object.file_name) : "", - duplicateAction: isSet(object.duplicateAction) - ? globalThis.String(object.duplicateAction) - : isSet(object.duplicate_action) - ? globalThis.String(object.duplicate_action) - : "", }; }, - toJSON(message: ImportProductGradesRequest): unknown { + toJSON(message: ImportLookupMastersRequest): unknown { const obj: any = {}; if (message.fileContent.length !== 0) { obj.fileContent = base64FromBytes(message.fileContent); @@ -11730,227 +21573,48 @@ export const ImportProductGradesRequest: MessageFns if (message.fileName !== "") { obj.fileName = message.fileName; } - if (message.duplicateAction !== "") { - obj.duplicateAction = message.duplicateAction; - } - return obj; - }, - - create(base?: DeepPartial): ImportProductGradesRequest { - return ImportProductGradesRequest.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): ImportProductGradesRequest { - const message = createBaseImportProductGradesRequest(); - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; - message.duplicateAction = object.duplicateAction ?? ""; - return message; - }, -}; - -function createBaseImportProductGradesResponse(): ImportProductGradesResponse { - return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; -} - -export const ImportProductGradesResponse: MessageFns = { - encode(message: ImportProductGradesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); - } - if (message.successCount !== 0) { - writer.uint32(16).int32(message.successCount); - } - if (message.skippedCount !== 0) { - writer.uint32(24).int32(message.skippedCount); - } - if (message.failedCount !== 0) { - writer.uint32(32).int32(message.failedCount); - } - for (const v of message.errors) { - ImportError.encode(v!, writer.uint32(42).fork()).join(); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ImportProductGradesResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportProductGradesResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.base = BaseResponse.decode(reader, reader.uint32()); - continue; - } - case 2: { - if (tag !== 16) { - break; - } - - message.successCount = reader.int32(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.skippedCount = reader.int32(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.failedCount = reader.int32(); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.errors.push(ImportError.decode(reader, reader.uint32())); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ImportProductGradesResponse { - return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - successCount: isSet(object.successCount) - ? globalThis.Number(object.successCount) - : isSet(object.success_count) - ? globalThis.Number(object.success_count) - : 0, - skippedCount: isSet(object.skippedCount) - ? globalThis.Number(object.skippedCount) - : isSet(object.skipped_count) - ? globalThis.Number(object.skipped_count) - : 0, - failedCount: isSet(object.failedCount) - ? globalThis.Number(object.failedCount) - : isSet(object.failed_count) - ? globalThis.Number(object.failed_count) - : 0, - errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => ImportError.fromJSON(e)) : [], - }; - }, - - toJSON(message: ImportProductGradesResponse): unknown { - const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); - } - if (message.successCount !== 0) { - obj.successCount = Math.round(message.successCount); - } - if (message.skippedCount !== 0) { - obj.skippedCount = Math.round(message.skippedCount); - } - if (message.failedCount !== 0) { - obj.failedCount = Math.round(message.failedCount); - } - if (message.errors?.length) { - obj.errors = message.errors.map((e) => ImportError.toJSON(e)); - } - return obj; - }, - - create(base?: DeepPartial): ImportProductGradesResponse { - return ImportProductGradesResponse.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): ImportProductGradesResponse { - const message = createBaseImportProductGradesResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.successCount = object.successCount ?? 0; - message.skippedCount = object.skippedCount ?? 0; - message.failedCount = object.failedCount ?? 0; - message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseDownloadProductGradeTemplateRequest(): DownloadProductGradeTemplateRequest { - return {}; -} - -export const DownloadProductGradeTemplateRequest: MessageFns = { - encode(_: DownloadProductGradeTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): DownloadProductGradeTemplateRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDownloadProductGradeTemplateRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(_: any): DownloadProductGradeTemplateRequest { - return {}; - }, - - toJSON(_: DownloadProductGradeTemplateRequest): unknown { - const obj: any = {}; return obj; }, - - create(base?: DeepPartial): DownloadProductGradeTemplateRequest { - return DownloadProductGradeTemplateRequest.fromPartial(base ?? {}); + + create(base?: DeepPartial): ImportLookupMastersRequest { + return ImportLookupMastersRequest.fromPartial(base ?? {}); }, - fromPartial(_: DeepPartial): DownloadProductGradeTemplateRequest { - const message = createBaseDownloadProductGradeTemplateRequest(); + fromPartial(object: DeepPartial): ImportLookupMastersRequest { + const message = createBaseImportLookupMastersRequest(); + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; return message; }, }; -function createBaseDownloadProductGradeTemplateResponse(): DownloadProductGradeTemplateResponse { - return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +function createBaseImportLookupMastersResponse(): ImportLookupMastersResponse { + return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; } -export const DownloadProductGradeTemplateResponse: MessageFns = { - encode(message: DownloadProductGradeTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ImportLookupMastersResponse: MessageFns = { + encode(message: ImportLookupMastersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.fileContent.length !== 0) { - writer.uint32(18).bytes(message.fileContent); + if (message.successCount !== 0) { + writer.uint32(16).int32(message.successCount); } - if (message.fileName !== "") { - writer.uint32(26).string(message.fileName); + if (message.skippedCount !== 0) { + writer.uint32(24).int32(message.skippedCount); + } + if (message.failedCount !== 0) { + writer.uint32(32).int32(message.failedCount); + } + for (const v of message.errors) { + writer.uint32(42).string(v!); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DownloadProductGradeTemplateResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ImportLookupMastersResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDownloadProductGradeTemplateResponse(); + const message = createBaseImportLookupMastersResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -11963,19 +21627,35 @@ export const DownloadProductGradeTemplateResponse: MessageFns globalThis.String(e)) : [], }; }, - toJSON(message: DownloadProductGradeTemplateResponse): unknown { + toJSON(message: ImportLookupMastersResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.fileContent.length !== 0) { - obj.fileContent = base64FromBytes(message.fileContent); + if (message.successCount !== 0) { + obj.successCount = Math.round(message.successCount); } - if (message.fileName !== "") { - obj.fileName = message.fileName; + if (message.skippedCount !== 0) { + obj.skippedCount = Math.round(message.skippedCount); + } + if (message.failedCount !== 0) { + obj.failedCount = Math.round(message.failedCount); + } + if (message.errors?.length) { + obj.errors = message.errors; } return obj; }, - create(base?: DeepPartial): DownloadProductGradeTemplateResponse { - return DownloadProductGradeTemplateResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ImportLookupMastersResponse { + return ImportLookupMastersResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DownloadProductGradeTemplateResponse { - const message = createBaseDownloadProductGradeTemplateResponse(); + fromPartial(object: DeepPartial): ImportLookupMastersResponse { + const message = createBaseImportLookupMastersResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; + message.successCount = object.successCount ?? 0; + message.skippedCount = object.skippedCount ?? 0; + message.failedCount = object.failedCount ?? 0; + message.errors = object.errors?.map((e) => e) || []; return message; }, }; -function createBaseMBHead(): MBHead { +function createBaseMbComposition(): MbComposition { return { + mbcmId: "", mbhId: "", - mbhOracleSysId: "", - mbhMbCosting: "", - mbhMgtName: "", - mbhDenier: undefined, - mbhFilament: undefined, - mbhDozing: undefined, - mbhIsActive: false, - mbhCheckStatus: undefined, - mbhStatus: undefined, - mbhLdrPrsn: undefined, - mbhFinalProduct: undefined, - mbhCode: undefined, + seqNo: 0, + groupHeadId: "", + compositionPct: "", + sourceType: "", + mbRefMbhId: "", + isCarrier: false, + legacySysId: "", audit: undefined, }; } -export const MBHead: MessageFns = { - encode(message: MBHead, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); - } - if (message.mbhOracleSysId !== "") { - writer.uint32(18).string(message.mbhOracleSysId); - } - if (message.mbhMbCosting !== "") { - writer.uint32(26).string(message.mbhMbCosting); - } - if (message.mbhMgtName !== "") { - writer.uint32(34).string(message.mbhMgtName); - } - if (message.mbhDenier !== undefined) { - writer.uint32(41).double(message.mbhDenier); +export const MbComposition: MessageFns = { + encode(message: MbComposition, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbcmId !== "") { + writer.uint32(10).string(message.mbcmId); } - if (message.mbhFilament !== undefined) { - writer.uint32(48).int32(message.mbhFilament); + if (message.mbhId !== "") { + writer.uint32(18).string(message.mbhId); } - if (message.mbhDozing !== undefined) { - writer.uint32(57).double(message.mbhDozing); + if (message.seqNo !== 0) { + writer.uint32(24).int32(message.seqNo); } - if (message.mbhIsActive !== false) { - writer.uint32(64).bool(message.mbhIsActive); + if (message.groupHeadId !== "") { + writer.uint32(34).string(message.groupHeadId); } - if (message.mbhCheckStatus !== undefined) { - writer.uint32(74).string(message.mbhCheckStatus); + if (message.compositionPct !== "") { + writer.uint32(42).string(message.compositionPct); } - if (message.mbhStatus !== undefined) { - writer.uint32(82).string(message.mbhStatus); + if (message.sourceType !== "") { + writer.uint32(50).string(message.sourceType); } - if (message.mbhLdrPrsn !== undefined) { - writer.uint32(89).double(message.mbhLdrPrsn); + if (message.mbRefMbhId !== "") { + writer.uint32(58).string(message.mbRefMbhId); } - if (message.mbhFinalProduct !== undefined) { - writer.uint32(98).string(message.mbhFinalProduct); + if (message.isCarrier !== false) { + writer.uint32(64).bool(message.isCarrier); } - if (message.mbhCode !== undefined) { - writer.uint32(106).string(message.mbhCode); + if (message.legacySysId !== "") { + writer.uint32(74).string(message.legacySysId); } if (message.audit !== undefined) { - AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); + AuditInfo.encode(message.audit, writer.uint32(82).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MBHead { + decode(input: BinaryReader | Uint8Array, length?: number): MbComposition { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMBHead(); + const message = createBaseMbComposition(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -12109,7 +21787,7 @@ export const MBHead: MessageFns = { break; } - message.mbhId = reader.string(); + message.mbcmId = reader.string(); continue; } case 2: { @@ -12117,15 +21795,15 @@ export const MBHead: MessageFns = { break; } - message.mbhOracleSysId = reader.string(); + message.mbhId = reader.string(); continue; } case 3: { - if (tag !== 26) { + if (tag !== 24) { break; } - message.mbhMbCosting = reader.string(); + message.seqNo = reader.int32(); continue; } case 4: { @@ -12133,31 +21811,31 @@ export const MBHead: MessageFns = { break; } - message.mbhMgtName = reader.string(); + message.groupHeadId = reader.string(); continue; } case 5: { - if (tag !== 41) { + if (tag !== 42) { break; } - message.mbhDenier = reader.double(); + message.compositionPct = reader.string(); continue; } case 6: { - if (tag !== 48) { + if (tag !== 50) { break; } - message.mbhFilament = reader.int32(); + message.sourceType = reader.string(); continue; } case 7: { - if (tag !== 57) { + if (tag !== 58) { break; } - message.mbhDozing = reader.double(); + message.mbRefMbhId = reader.string(); continue; } case 8: { @@ -12165,7 +21843,7 @@ export const MBHead: MessageFns = { break; } - message.mbhIsActive = reader.bool(); + message.isCarrier = reader.bool(); continue; } case 9: { @@ -12173,7 +21851,7 @@ export const MBHead: MessageFns = { break; } - message.mbhCheckStatus = reader.string(); + message.legacySysId = reader.string(); continue; } case 10: { @@ -12181,38 +21859,6 @@ export const MBHead: MessageFns = { break; } - message.mbhStatus = reader.string(); - continue; - } - case 11: { - if (tag !== 89) { - break; - } - - message.mbhLdrPrsn = reader.double(); - continue; - } - case 12: { - if (tag !== 98) { - break; - } - - message.mbhFinalProduct = reader.string(); - continue; - } - case 13: { - if (tag !== 106) { - break; - } - - message.mbhCode = reader.string(); - continue; - } - case 16: { - if (tag !== 130) { - break; - } - message.audit = AuditInfo.decode(reader, reader.uint32()); continue; } @@ -12225,117 +21871,85 @@ export const MBHead: MessageFns = { return message; }, - fromJSON(object: any): MBHead { + fromJSON(object: any): MbComposition { return { + mbcmId: isSet(object.mbcmId) + ? globalThis.String(object.mbcmId) + : isSet(object.mbcm_id) + ? globalThis.String(object.mbcm_id) + : "", mbhId: isSet(object.mbhId) ? globalThis.String(object.mbhId) : isSet(object.mbh_id) ? globalThis.String(object.mbh_id) : "", - mbhOracleSysId: isSet(object.mbhOracleSysId) - ? globalThis.String(object.mbhOracleSysId) - : isSet(object.mbh_oracle_sys_id) - ? globalThis.String(object.mbh_oracle_sys_id) + seqNo: isSet(object.seqNo) + ? globalThis.Number(object.seqNo) + : isSet(object.seq_no) + ? globalThis.Number(object.seq_no) + : 0, + groupHeadId: isSet(object.groupHeadId) + ? globalThis.String(object.groupHeadId) + : isSet(object.group_head_id) + ? globalThis.String(object.group_head_id) : "", - mbhMbCosting: isSet(object.mbhMbCosting) - ? globalThis.String(object.mbhMbCosting) - : isSet(object.mbh_mb_costing) - ? globalThis.String(object.mbh_mb_costing) + compositionPct: isSet(object.compositionPct) + ? globalThis.String(object.compositionPct) + : isSet(object.composition_pct) + ? globalThis.String(object.composition_pct) : "", - mbhMgtName: isSet(object.mbhMgtName) - ? globalThis.String(object.mbhMgtName) - : isSet(object.mbh_mgt_name) - ? globalThis.String(object.mbh_mgt_name) + sourceType: isSet(object.sourceType) + ? globalThis.String(object.sourceType) + : isSet(object.source_type) + ? globalThis.String(object.source_type) : "", - mbhDenier: isSet(object.mbhDenier) - ? globalThis.Number(object.mbhDenier) - : isSet(object.mbh_denier) - ? globalThis.Number(object.mbh_denier) - : undefined, - mbhFilament: isSet(object.mbhFilament) - ? globalThis.Number(object.mbhFilament) - : isSet(object.mbh_filament) - ? globalThis.Number(object.mbh_filament) - : undefined, - mbhDozing: isSet(object.mbhDozing) - ? globalThis.Number(object.mbhDozing) - : isSet(object.mbh_dozing) - ? globalThis.Number(object.mbh_dozing) - : undefined, - mbhIsActive: isSet(object.mbhIsActive) - ? globalThis.Boolean(object.mbhIsActive) - : isSet(object.mbh_is_active) - ? globalThis.Boolean(object.mbh_is_active) + mbRefMbhId: isSet(object.mbRefMbhId) + ? globalThis.String(object.mbRefMbhId) + : isSet(object.mb_ref_mbh_id) + ? globalThis.String(object.mb_ref_mbh_id) + : "", + isCarrier: isSet(object.isCarrier) + ? globalThis.Boolean(object.isCarrier) + : isSet(object.is_carrier) + ? globalThis.Boolean(object.is_carrier) : false, - mbhCheckStatus: isSet(object.mbhCheckStatus) - ? globalThis.String(object.mbhCheckStatus) - : isSet(object.mbh_check_status) - ? globalThis.String(object.mbh_check_status) - : undefined, - mbhStatus: isSet(object.mbhStatus) - ? globalThis.String(object.mbhStatus) - : isSet(object.mbh_status) - ? globalThis.String(object.mbh_status) - : undefined, - mbhLdrPrsn: isSet(object.mbhLdrPrsn) - ? globalThis.Number(object.mbhLdrPrsn) - : isSet(object.mbh_ldr_prsn) - ? globalThis.Number(object.mbh_ldr_prsn) - : undefined, - mbhFinalProduct: isSet(object.mbhFinalProduct) - ? globalThis.String(object.mbhFinalProduct) - : isSet(object.mbh_final_product) - ? globalThis.String(object.mbh_final_product) - : undefined, - mbhCode: isSet(object.mbhCode) - ? globalThis.String(object.mbhCode) - : isSet(object.mbh_code) - ? globalThis.String(object.mbh_code) - : undefined, + legacySysId: isSet(object.legacySysId) + ? globalThis.String(object.legacySysId) + : isSet(object.legacy_sys_id) + ? globalThis.String(object.legacy_sys_id) + : "", audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, }; }, - toJSON(message: MBHead): unknown { + toJSON(message: MbComposition): unknown { const obj: any = {}; + if (message.mbcmId !== "") { + obj.mbcmId = message.mbcmId; + } if (message.mbhId !== "") { obj.mbhId = message.mbhId; } - if (message.mbhOracleSysId !== "") { - obj.mbhOracleSysId = message.mbhOracleSysId; - } - if (message.mbhMbCosting !== "") { - obj.mbhMbCosting = message.mbhMbCosting; - } - if (message.mbhMgtName !== "") { - obj.mbhMgtName = message.mbhMgtName; - } - if (message.mbhDenier !== undefined) { - obj.mbhDenier = message.mbhDenier; - } - if (message.mbhFilament !== undefined) { - obj.mbhFilament = Math.round(message.mbhFilament); - } - if (message.mbhDozing !== undefined) { - obj.mbhDozing = message.mbhDozing; + if (message.seqNo !== 0) { + obj.seqNo = Math.round(message.seqNo); } - if (message.mbhIsActive !== false) { - obj.mbhIsActive = message.mbhIsActive; + if (message.groupHeadId !== "") { + obj.groupHeadId = message.groupHeadId; } - if (message.mbhCheckStatus !== undefined) { - obj.mbhCheckStatus = message.mbhCheckStatus; + if (message.compositionPct !== "") { + obj.compositionPct = message.compositionPct; } - if (message.mbhStatus !== undefined) { - obj.mbhStatus = message.mbhStatus; + if (message.sourceType !== "") { + obj.sourceType = message.sourceType; } - if (message.mbhLdrPrsn !== undefined) { - obj.mbhLdrPrsn = message.mbhLdrPrsn; + if (message.mbRefMbhId !== "") { + obj.mbRefMbhId = message.mbRefMbhId; } - if (message.mbhFinalProduct !== undefined) { - obj.mbhFinalProduct = message.mbhFinalProduct; + if (message.isCarrier !== false) { + obj.isCarrier = message.isCarrier; } - if (message.mbhCode !== undefined) { - obj.mbhCode = message.mbhCode; + if (message.legacySysId !== "") { + obj.legacySysId = message.legacySysId; } if (message.audit !== undefined) { obj.audit = AuditInfo.toJSON(message.audit); @@ -12343,24 +21957,20 @@ export const MBHead: MessageFns = { return obj; }, - create(base?: DeepPartial): MBHead { - return MBHead.fromPartial(base ?? {}); + create(base?: DeepPartial): MbComposition { + return MbComposition.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): MBHead { - const message = createBaseMBHead(); + fromPartial(object: DeepPartial): MbComposition { + const message = createBaseMbComposition(); + message.mbcmId = object.mbcmId ?? ""; message.mbhId = object.mbhId ?? ""; - message.mbhOracleSysId = object.mbhOracleSysId ?? ""; - message.mbhMbCosting = object.mbhMbCosting ?? ""; - message.mbhMgtName = object.mbhMgtName ?? ""; - message.mbhDenier = object.mbhDenier ?? undefined; - message.mbhFilament = object.mbhFilament ?? undefined; - message.mbhDozing = object.mbhDozing ?? undefined; - message.mbhIsActive = object.mbhIsActive ?? false; - message.mbhCheckStatus = object.mbhCheckStatus ?? undefined; - message.mbhStatus = object.mbhStatus ?? undefined; - message.mbhLdrPrsn = object.mbhLdrPrsn ?? undefined; - message.mbhFinalProduct = object.mbhFinalProduct ?? undefined; - message.mbhCode = object.mbhCode ?? undefined; + message.seqNo = object.seqNo ?? 0; + message.groupHeadId = object.groupHeadId ?? ""; + message.compositionPct = object.compositionPct ?? ""; + message.sourceType = object.sourceType ?? ""; + message.mbRefMbhId = object.mbRefMbhId ?? ""; + message.isCarrier = object.isCarrier ?? false; + message.legacySysId = object.legacySysId ?? ""; message.audit = (object.audit !== undefined && object.audit !== null) ? AuditInfo.fromPartial(object.audit) : undefined; @@ -12368,64 +21978,64 @@ export const MBHead: MessageFns = { }, }; -function createBaseCreateMBHeadRequest(): CreateMBHeadRequest { +function createBaseMbCompositionVersion(): MbCompositionVersion { return { - mbhMbCosting: "", - mbhOracleSysId: undefined, - mbhMgtName: undefined, - mbhDenier: undefined, - mbhFilament: undefined, - mbhDozing: undefined, - mbhCheckStatus: undefined, - mbhStatus: undefined, - mbhLdrPrsn: undefined, - mbhFinalProduct: undefined, - mbhCode: undefined, + mbcvId: "", + mbhId: "", + version: 0, + validatedAt: "", + validatedBy: "", + seqNo: 0, + groupHeadId: "", + compositionPct: "", + sourceType: "", + mbRefMbhId: "", + isCarrier: false, }; } -export const CreateMBHeadRequest: MessageFns = { - encode(message: CreateMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhMbCosting !== "") { - writer.uint32(10).string(message.mbhMbCosting); +export const MbCompositionVersion: MessageFns = { + encode(message: MbCompositionVersion, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbcvId !== "") { + writer.uint32(10).string(message.mbcvId); } - if (message.mbhOracleSysId !== undefined) { - writer.uint32(18).string(message.mbhOracleSysId); + if (message.mbhId !== "") { + writer.uint32(18).string(message.mbhId); } - if (message.mbhMgtName !== undefined) { - writer.uint32(26).string(message.mbhMgtName); + if (message.version !== 0) { + writer.uint32(24).int32(message.version); } - if (message.mbhDenier !== undefined) { - writer.uint32(33).double(message.mbhDenier); + if (message.validatedAt !== "") { + writer.uint32(34).string(message.validatedAt); } - if (message.mbhFilament !== undefined) { - writer.uint32(40).int32(message.mbhFilament); + if (message.validatedBy !== "") { + writer.uint32(42).string(message.validatedBy); } - if (message.mbhDozing !== undefined) { - writer.uint32(49).double(message.mbhDozing); + if (message.seqNo !== 0) { + writer.uint32(48).int32(message.seqNo); } - if (message.mbhCheckStatus !== undefined) { - writer.uint32(58).string(message.mbhCheckStatus); + if (message.groupHeadId !== "") { + writer.uint32(58).string(message.groupHeadId); } - if (message.mbhStatus !== undefined) { - writer.uint32(66).string(message.mbhStatus); + if (message.compositionPct !== "") { + writer.uint32(66).string(message.compositionPct); } - if (message.mbhLdrPrsn !== undefined) { - writer.uint32(73).double(message.mbhLdrPrsn); + if (message.sourceType !== "") { + writer.uint32(74).string(message.sourceType); } - if (message.mbhFinalProduct !== undefined) { - writer.uint32(82).string(message.mbhFinalProduct); + if (message.mbRefMbhId !== "") { + writer.uint32(82).string(message.mbRefMbhId); } - if (message.mbhCode !== undefined) { - writer.uint32(90).string(message.mbhCode); + if (message.isCarrier !== false) { + writer.uint32(88).bool(message.isCarrier); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateMBHeadRequest { + decode(input: BinaryReader | Uint8Array, length?: number): MbCompositionVersion { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateMBHeadRequest(); + const message = createBaseMbCompositionVersion(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -12434,7 +22044,7 @@ export const CreateMBHeadRequest: MessageFns = { break; } - message.mbhMbCosting = reader.string(); + message.mbcvId = reader.string(); continue; } case 2: { @@ -12442,39 +22052,39 @@ export const CreateMBHeadRequest: MessageFns = { break; } - message.mbhOracleSysId = reader.string(); + message.mbhId = reader.string(); continue; } case 3: { - if (tag !== 26) { + if (tag !== 24) { break; } - message.mbhMgtName = reader.string(); + message.version = reader.int32(); continue; } case 4: { - if (tag !== 33) { + if (tag !== 34) { break; } - message.mbhDenier = reader.double(); + message.validatedAt = reader.string(); continue; } case 5: { - if (tag !== 40) { + if (tag !== 42) { break; } - message.mbhFilament = reader.int32(); + message.validatedBy = reader.string(); continue; } case 6: { - if (tag !== 49) { + if (tag !== 48) { break; } - message.mbhDozing = reader.double(); + message.seqNo = reader.int32(); continue; } case 7: { @@ -12482,7 +22092,7 @@ export const CreateMBHeadRequest: MessageFns = { break; } - message.mbhCheckStatus = reader.string(); + message.groupHeadId = reader.string(); continue; } case 8: { @@ -12490,15 +22100,15 @@ export const CreateMBHeadRequest: MessageFns = { break; } - message.mbhStatus = reader.string(); + message.compositionPct = reader.string(); continue; } case 9: { - if (tag !== 73) { + if (tag !== 74) { break; } - message.mbhLdrPrsn = reader.double(); + message.sourceType = reader.string(); continue; } case 10: { @@ -12506,15 +22116,15 @@ export const CreateMBHeadRequest: MessageFns = { break; } - message.mbhFinalProduct = reader.string(); + message.mbRefMbhId = reader.string(); continue; } case 11: { - if (tag !== 90) { + if (tag !== 88) { break; } - message.mbhCode = reader.string(); + message.isCarrier = reader.bool(); continue; } } @@ -12526,143 +22136,166 @@ export const CreateMBHeadRequest: MessageFns = { return message; }, - fromJSON(object: any): CreateMBHeadRequest { + fromJSON(object: any): MbCompositionVersion { return { - mbhMbCosting: isSet(object.mbhMbCosting) - ? globalThis.String(object.mbhMbCosting) - : isSet(object.mbh_mb_costing) - ? globalThis.String(object.mbh_mb_costing) + mbcvId: isSet(object.mbcvId) + ? globalThis.String(object.mbcvId) + : isSet(object.mbcv_id) + ? globalThis.String(object.mbcv_id) : "", - mbhOracleSysId: isSet(object.mbhOracleSysId) - ? globalThis.String(object.mbhOracleSysId) - : isSet(object.mbh_oracle_sys_id) - ? globalThis.String(object.mbh_oracle_sys_id) - : undefined, - mbhMgtName: isSet(object.mbhMgtName) - ? globalThis.String(object.mbhMgtName) - : isSet(object.mbh_mgt_name) - ? globalThis.String(object.mbh_mgt_name) - : undefined, - mbhDenier: isSet(object.mbhDenier) - ? globalThis.Number(object.mbhDenier) - : isSet(object.mbh_denier) - ? globalThis.Number(object.mbh_denier) - : undefined, - mbhFilament: isSet(object.mbhFilament) - ? globalThis.Number(object.mbhFilament) - : isSet(object.mbh_filament) - ? globalThis.Number(object.mbh_filament) - : undefined, - mbhDozing: isSet(object.mbhDozing) - ? globalThis.Number(object.mbhDozing) - : isSet(object.mbh_dozing) - ? globalThis.Number(object.mbh_dozing) - : undefined, - mbhCheckStatus: isSet(object.mbhCheckStatus) - ? globalThis.String(object.mbhCheckStatus) - : isSet(object.mbh_check_status) - ? globalThis.String(object.mbh_check_status) - : undefined, - mbhStatus: isSet(object.mbhStatus) - ? globalThis.String(object.mbhStatus) - : isSet(object.mbh_status) - ? globalThis.String(object.mbh_status) - : undefined, - mbhLdrPrsn: isSet(object.mbhLdrPrsn) - ? globalThis.Number(object.mbhLdrPrsn) - : isSet(object.mbh_ldr_prsn) - ? globalThis.Number(object.mbh_ldr_prsn) - : undefined, - mbhFinalProduct: isSet(object.mbhFinalProduct) - ? globalThis.String(object.mbhFinalProduct) - : isSet(object.mbh_final_product) - ? globalThis.String(object.mbh_final_product) - : undefined, - mbhCode: isSet(object.mbhCode) - ? globalThis.String(object.mbhCode) - : isSet(object.mbh_code) - ? globalThis.String(object.mbh_code) - : undefined, + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + version: isSet(object.version) ? globalThis.Number(object.version) : 0, + validatedAt: isSet(object.validatedAt) + ? globalThis.String(object.validatedAt) + : isSet(object.validated_at) + ? globalThis.String(object.validated_at) + : "", + validatedBy: isSet(object.validatedBy) + ? globalThis.String(object.validatedBy) + : isSet(object.validated_by) + ? globalThis.String(object.validated_by) + : "", + seqNo: isSet(object.seqNo) + ? globalThis.Number(object.seqNo) + : isSet(object.seq_no) + ? globalThis.Number(object.seq_no) + : 0, + groupHeadId: isSet(object.groupHeadId) + ? globalThis.String(object.groupHeadId) + : isSet(object.group_head_id) + ? globalThis.String(object.group_head_id) + : "", + compositionPct: isSet(object.compositionPct) + ? globalThis.String(object.compositionPct) + : isSet(object.composition_pct) + ? globalThis.String(object.composition_pct) + : "", + sourceType: isSet(object.sourceType) + ? globalThis.String(object.sourceType) + : isSet(object.source_type) + ? globalThis.String(object.source_type) + : "", + mbRefMbhId: isSet(object.mbRefMbhId) + ? globalThis.String(object.mbRefMbhId) + : isSet(object.mb_ref_mbh_id) + ? globalThis.String(object.mb_ref_mbh_id) + : "", + isCarrier: isSet(object.isCarrier) + ? globalThis.Boolean(object.isCarrier) + : isSet(object.is_carrier) + ? globalThis.Boolean(object.is_carrier) + : false, }; }, - toJSON(message: CreateMBHeadRequest): unknown { + toJSON(message: MbCompositionVersion): unknown { const obj: any = {}; - if (message.mbhMbCosting !== "") { - obj.mbhMbCosting = message.mbhMbCosting; - } - if (message.mbhOracleSysId !== undefined) { - obj.mbhOracleSysId = message.mbhOracleSysId; + if (message.mbcvId !== "") { + obj.mbcvId = message.mbcvId; } - if (message.mbhMgtName !== undefined) { - obj.mbhMgtName = message.mbhMgtName; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } - if (message.mbhDenier !== undefined) { - obj.mbhDenier = message.mbhDenier; + if (message.version !== 0) { + obj.version = Math.round(message.version); } - if (message.mbhFilament !== undefined) { - obj.mbhFilament = Math.round(message.mbhFilament); + if (message.validatedAt !== "") { + obj.validatedAt = message.validatedAt; } - if (message.mbhDozing !== undefined) { - obj.mbhDozing = message.mbhDozing; + if (message.validatedBy !== "") { + obj.validatedBy = message.validatedBy; } - if (message.mbhCheckStatus !== undefined) { - obj.mbhCheckStatus = message.mbhCheckStatus; + if (message.seqNo !== 0) { + obj.seqNo = Math.round(message.seqNo); } - if (message.mbhStatus !== undefined) { - obj.mbhStatus = message.mbhStatus; + if (message.groupHeadId !== "") { + obj.groupHeadId = message.groupHeadId; } - if (message.mbhLdrPrsn !== undefined) { - obj.mbhLdrPrsn = message.mbhLdrPrsn; + if (message.compositionPct !== "") { + obj.compositionPct = message.compositionPct; } - if (message.mbhFinalProduct !== undefined) { - obj.mbhFinalProduct = message.mbhFinalProduct; + if (message.sourceType !== "") { + obj.sourceType = message.sourceType; } - if (message.mbhCode !== undefined) { - obj.mbhCode = message.mbhCode; + if (message.mbRefMbhId !== "") { + obj.mbRefMbhId = message.mbRefMbhId; } - return obj; - }, - - create(base?: DeepPartial): CreateMBHeadRequest { - return CreateMBHeadRequest.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): CreateMBHeadRequest { - const message = createBaseCreateMBHeadRequest(); - message.mbhMbCosting = object.mbhMbCosting ?? ""; - message.mbhOracleSysId = object.mbhOracleSysId ?? undefined; - message.mbhMgtName = object.mbhMgtName ?? undefined; - message.mbhDenier = object.mbhDenier ?? undefined; - message.mbhFilament = object.mbhFilament ?? undefined; - message.mbhDozing = object.mbhDozing ?? undefined; - message.mbhCheckStatus = object.mbhCheckStatus ?? undefined; - message.mbhStatus = object.mbhStatus ?? undefined; - message.mbhLdrPrsn = object.mbhLdrPrsn ?? undefined; - message.mbhFinalProduct = object.mbhFinalProduct ?? undefined; - message.mbhCode = object.mbhCode ?? undefined; + if (message.isCarrier !== false) { + obj.isCarrier = message.isCarrier; + } + return obj; + }, + + create(base?: DeepPartial): MbCompositionVersion { + return MbCompositionVersion.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MbCompositionVersion { + const message = createBaseMbCompositionVersion(); + message.mbcvId = object.mbcvId ?? ""; + message.mbhId = object.mbhId ?? ""; + message.version = object.version ?? 0; + message.validatedAt = object.validatedAt ?? ""; + message.validatedBy = object.validatedBy ?? ""; + message.seqNo = object.seqNo ?? 0; + message.groupHeadId = object.groupHeadId ?? ""; + message.compositionPct = object.compositionPct ?? ""; + message.sourceType = object.sourceType ?? ""; + message.mbRefMbhId = object.mbRefMbhId ?? ""; + message.isCarrier = object.isCarrier ?? false; return message; }, }; -function createBaseCreateMBHeadResponse(): CreateMBHeadResponse { - return { base: undefined, data: undefined }; +function createBaseMbLusture(): MbLusture { + return { + mblId: "", + code: "", + displayName: "", + fullDescription: "", + category: "", + isActive: false, + displayOrder: 0, + audit: undefined, + }; } -export const CreateMBHeadResponse: MessageFns = { - encode(message: CreateMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); +export const MbLusture: MessageFns = { + encode(message: MbLusture, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mblId !== "") { + writer.uint32(10).string(message.mblId); } - if (message.data !== undefined) { - MBHead.encode(message.data, writer.uint32(18).fork()).join(); + if (message.code !== "") { + writer.uint32(18).string(message.code); + } + if (message.displayName !== "") { + writer.uint32(26).string(message.displayName); + } + if (message.fullDescription !== "") { + writer.uint32(34).string(message.fullDescription); + } + if (message.category !== "") { + writer.uint32(42).string(message.category); + } + if (message.isActive !== false) { + writer.uint32(48).bool(message.isActive); + } + if (message.displayOrder !== 0) { + writer.uint32(56).int32(message.displayOrder); + } + if (message.audit !== undefined) { + AuditInfo.encode(message.audit, writer.uint32(66).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateMBHeadResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MbLusture { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateMBHeadResponse(); + const message = createBaseMbLusture(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -12671,7 +22304,7 @@ export const CreateMBHeadResponse: MessageFns = { break; } - message.base = BaseResponse.decode(reader, reader.uint32()); + message.mblId = reader.string(); continue; } case 2: { @@ -12679,7 +22312,55 @@ export const CreateMBHeadResponse: MessageFns = { break; } - message.data = MBHead.decode(reader, reader.uint32()); + message.code = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.displayName = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.fullDescription = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.category = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.isActive = reader.bool(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.displayOrder = reader.int32(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.audit = AuditInfo.decode(reader, reader.uint32()); continue; } } @@ -12691,53 +22372,149 @@ export const CreateMBHeadResponse: MessageFns = { return message; }, - fromJSON(object: any): CreateMBHeadResponse { + fromJSON(object: any): MbLusture { return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? MBHead.fromJSON(object.data) : undefined, + mblId: isSet(object.mblId) + ? globalThis.String(object.mblId) + : isSet(object.mbl_id) + ? globalThis.String(object.mbl_id) + : "", + code: isSet(object.code) ? globalThis.String(object.code) : "", + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + fullDescription: isSet(object.fullDescription) + ? globalThis.String(object.fullDescription) + : isSet(object.full_description) + ? globalThis.String(object.full_description) + : "", + category: isSet(object.category) ? globalThis.String(object.category) : "", + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, + displayOrder: isSet(object.displayOrder) + ? globalThis.Number(object.displayOrder) + : isSet(object.display_order) + ? globalThis.Number(object.display_order) + : 0, + audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, }; }, - toJSON(message: CreateMBHeadResponse): unknown { + toJSON(message: MbLusture): unknown { const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); + if (message.mblId !== "") { + obj.mblId = message.mblId; } - if (message.data !== undefined) { - obj.data = MBHead.toJSON(message.data); + if (message.code !== "") { + obj.code = message.code; + } + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.fullDescription !== "") { + obj.fullDescription = message.fullDescription; + } + if (message.category !== "") { + obj.category = message.category; + } + if (message.isActive !== false) { + obj.isActive = message.isActive; + } + if (message.displayOrder !== 0) { + obj.displayOrder = Math.round(message.displayOrder); + } + if (message.audit !== undefined) { + obj.audit = AuditInfo.toJSON(message.audit); } return obj; }, - create(base?: DeepPartial): CreateMBHeadResponse { - return CreateMBHeadResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): MbLusture { + return MbLusture.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateMBHeadResponse { - const message = createBaseCreateMBHeadResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) + fromPartial(object: DeepPartial): MbLusture { + const message = createBaseMbLusture(); + message.mblId = object.mblId ?? ""; + message.code = object.code ?? ""; + message.displayName = object.displayName ?? ""; + message.fullDescription = object.fullDescription ?? ""; + message.category = object.category ?? ""; + message.isActive = object.isActive ?? false; + message.displayOrder = object.displayOrder ?? 0; + message.audit = (object.audit !== undefined && object.audit !== null) + ? AuditInfo.fromPartial(object.audit) : undefined; - message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; return message; }, }; -function createBaseGetMBHeadRequest(): GetMBHeadRequest { - return { mbhId: "" }; +function createBaseMbParam(): MbParam { + return { + mbpId: "", + code: "", + name: "", + description: "", + type: "", + defaultValue: "", + defaultOption: "", + unit: "", + displayOrder: 0, + isActive: false, + audit: undefined, + options: [], + }; } -export const GetMBHeadRequest: MessageFns = { - encode(message: GetMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); +export const MbParam: MessageFns = { + encode(message: MbParam, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbpId !== "") { + writer.uint32(10).string(message.mbpId); + } + if (message.code !== "") { + writer.uint32(18).string(message.code); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.type !== "") { + writer.uint32(42).string(message.type); + } + if (message.defaultValue !== "") { + writer.uint32(50).string(message.defaultValue); + } + if (message.defaultOption !== "") { + writer.uint32(58).string(message.defaultOption); + } + if (message.unit !== "") { + writer.uint32(66).string(message.unit); + } + if (message.displayOrder !== 0) { + writer.uint32(72).int32(message.displayOrder); + } + if (message.isActive !== false) { + writer.uint32(80).bool(message.isActive); + } + if (message.audit !== undefined) { + AuditInfo.encode(message.audit, writer.uint32(90).fork()).join(); + } + for (const v of message.options) { + MbParamOption.encode(v!, writer.uint32(98).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetMBHeadRequest { + decode(input: BinaryReader | Uint8Array, length?: number): MbParam { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetMBHeadRequest(); + const message = createBaseMbParam(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -12746,7 +22523,95 @@ export const GetMBHeadRequest: MessageFns = { break; } - message.mbhId = reader.string(); + message.mbpId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.code = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.name = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.description = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.type = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.defaultValue = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.defaultOption = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.unit = reader.string(); + continue; + } + case 9: { + if (tag !== 72) { + break; + } + + message.displayOrder = reader.int32(); + continue; + } + case 10: { + if (tag !== 80) { + break; + } + + message.isActive = reader.bool(); + continue; + } + case 11: { + if (tag !== 90) { + break; + } + + message.audit = AuditInfo.decode(reader, reader.uint32()); + continue; + } + case 12: { + if (tag !== 98) { + break; + } + + message.options.push(MbParamOption.decode(reader, reader.uint32())); continue; } } @@ -12758,53 +22623,143 @@ export const GetMBHeadRequest: MessageFns = { return message; }, - fromJSON(object: any): GetMBHeadRequest { + fromJSON(object: any): MbParam { return { - mbhId: isSet(object.mbhId) - ? globalThis.String(object.mbhId) - : isSet(object.mbh_id) - ? globalThis.String(object.mbh_id) + mbpId: isSet(object.mbpId) + ? globalThis.String(object.mbpId) + : isSet(object.mbp_id) + ? globalThis.String(object.mbp_id) + : "", + code: isSet(object.code) ? globalThis.String(object.code) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + type: isSet(object.type) ? globalThis.String(object.type) : "", + defaultValue: isSet(object.defaultValue) + ? globalThis.String(object.defaultValue) + : isSet(object.default_value) + ? globalThis.String(object.default_value) + : "", + defaultOption: isSet(object.defaultOption) + ? globalThis.String(object.defaultOption) + : isSet(object.default_option) + ? globalThis.String(object.default_option) : "", + unit: isSet(object.unit) ? globalThis.String(object.unit) : "", + displayOrder: isSet(object.displayOrder) + ? globalThis.Number(object.displayOrder) + : isSet(object.display_order) + ? globalThis.Number(object.display_order) + : 0, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, + audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, + options: globalThis.Array.isArray(object?.options) + ? object.options.map((e: any) => MbParamOption.fromJSON(e)) + : [], }; }, - toJSON(message: GetMBHeadRequest): unknown { + toJSON(message: MbParam): unknown { const obj: any = {}; - if (message.mbhId !== "") { - obj.mbhId = message.mbhId; + if (message.mbpId !== "") { + obj.mbpId = message.mbpId; + } + if (message.code !== "") { + obj.code = message.code; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.type !== "") { + obj.type = message.type; + } + if (message.defaultValue !== "") { + obj.defaultValue = message.defaultValue; + } + if (message.defaultOption !== "") { + obj.defaultOption = message.defaultOption; + } + if (message.unit !== "") { + obj.unit = message.unit; + } + if (message.displayOrder !== 0) { + obj.displayOrder = Math.round(message.displayOrder); + } + if (message.isActive !== false) { + obj.isActive = message.isActive; + } + if (message.audit !== undefined) { + obj.audit = AuditInfo.toJSON(message.audit); + } + if (message.options?.length) { + obj.options = message.options.map((e) => MbParamOption.toJSON(e)); } return obj; }, - create(base?: DeepPartial): GetMBHeadRequest { - return GetMBHeadRequest.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): GetMBHeadRequest { - const message = createBaseGetMBHeadRequest(); - message.mbhId = object.mbhId ?? ""; + create(base?: DeepPartial): MbParam { + return MbParam.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): MbParam { + const message = createBaseMbParam(); + message.mbpId = object.mbpId ?? ""; + message.code = object.code ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.type = object.type ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.defaultOption = object.defaultOption ?? ""; + message.unit = object.unit ?? ""; + message.displayOrder = object.displayOrder ?? 0; + message.isActive = object.isActive ?? false; + message.audit = (object.audit !== undefined && object.audit !== null) + ? AuditInfo.fromPartial(object.audit) + : undefined; + message.options = object.options?.map((e) => MbParamOption.fromPartial(e)) || []; return message; }, }; -function createBaseGetMBHeadResponse(): GetMBHeadResponse { - return { base: undefined, data: undefined }; +function createBaseMbParamOption(): MbParamOption { + return { mbpoId: "", mbpCode: "", code: "", numericValue: "", description: "", displayOrder: 0, isActive: false }; } -export const GetMBHeadResponse: MessageFns = { - encode(message: GetMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); +export const MbParamOption: MessageFns = { + encode(message: MbParamOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbpoId !== "") { + writer.uint32(10).string(message.mbpoId); } - if (message.data !== undefined) { - MBHead.encode(message.data, writer.uint32(18).fork()).join(); + if (message.mbpCode !== "") { + writer.uint32(18).string(message.mbpCode); + } + if (message.code !== "") { + writer.uint32(26).string(message.code); + } + if (message.numericValue !== "") { + writer.uint32(34).string(message.numericValue); + } + if (message.description !== "") { + writer.uint32(42).string(message.description); + } + if (message.displayOrder !== 0) { + writer.uint32(48).int32(message.displayOrder); + } + if (message.isActive !== false) { + writer.uint32(56).bool(message.isActive); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetMBHeadResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MbParamOption { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetMBHeadResponse(); + const message = createBaseMbParamOption(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -12813,7 +22768,7 @@ export const GetMBHeadResponse: MessageFns = { break; } - message.base = BaseResponse.decode(reader, reader.uint32()); + message.mbpoId = reader.string(); continue; } case 2: { @@ -12821,7 +22776,47 @@ export const GetMBHeadResponse: MessageFns = { break; } - message.data = MBHead.decode(reader, reader.uint32()); + message.mbpCode = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.code = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.numericValue = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.description = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.displayOrder = reader.int32(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.isActive = reader.bool(); continue; } } @@ -12833,99 +22828,130 @@ export const GetMBHeadResponse: MessageFns = { return message; }, - fromJSON(object: any): GetMBHeadResponse { + fromJSON(object: any): MbParamOption { return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? MBHead.fromJSON(object.data) : undefined, + mbpoId: isSet(object.mbpoId) + ? globalThis.String(object.mbpoId) + : isSet(object.mbpo_id) + ? globalThis.String(object.mbpo_id) + : "", + mbpCode: isSet(object.mbpCode) + ? globalThis.String(object.mbpCode) + : isSet(object.mbp_code) + ? globalThis.String(object.mbp_code) + : "", + code: isSet(object.code) ? globalThis.String(object.code) : "", + numericValue: isSet(object.numericValue) + ? globalThis.String(object.numericValue) + : isSet(object.numeric_value) + ? globalThis.String(object.numeric_value) + : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + displayOrder: isSet(object.displayOrder) + ? globalThis.Number(object.displayOrder) + : isSet(object.display_order) + ? globalThis.Number(object.display_order) + : 0, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, }; }, - toJSON(message: GetMBHeadResponse): unknown { + toJSON(message: MbParamOption): unknown { const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); + if (message.mbpoId !== "") { + obj.mbpoId = message.mbpoId; } - if (message.data !== undefined) { - obj.data = MBHead.toJSON(message.data); + if (message.mbpCode !== "") { + obj.mbpCode = message.mbpCode; + } + if (message.code !== "") { + obj.code = message.code; + } + if (message.numericValue !== "") { + obj.numericValue = message.numericValue; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.displayOrder !== 0) { + obj.displayOrder = Math.round(message.displayOrder); + } + if (message.isActive !== false) { + obj.isActive = message.isActive; } return obj; }, - create(base?: DeepPartial): GetMBHeadResponse { - return GetMBHeadResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): MbParamOption { + return MbParamOption.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetMBHeadResponse { - const message = createBaseGetMBHeadResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; + fromPartial(object: DeepPartial): MbParamOption { + const message = createBaseMbParamOption(); + message.mbpoId = object.mbpoId ?? ""; + message.mbpCode = object.mbpCode ?? ""; + message.code = object.code ?? ""; + message.numericValue = object.numericValue ?? ""; + message.description = object.description ?? ""; + message.displayOrder = object.displayOrder ?? 0; + message.isActive = object.isActive ?? false; return message; }, }; -function createBaseUpdateMBHeadRequest(): UpdateMBHeadRequest { +function createBaseMbCost(): MbCost { return { + mbcId: "", mbhId: "", - mbhMbCosting: undefined, - mbhMgtName: undefined, - mbhDenier: undefined, - mbhFilament: undefined, - mbhDozing: undefined, - mbhIsActive: undefined, - mbhCheckStatus: undefined, - mbhStatus: undefined, - mbhLdrPrsn: undefined, - mbhFinalProduct: undefined, - mbhCode: undefined, + period: "", + costType: "", + costValue: "", + sourceCpcId: 0, + pushedAt: "", + pushedBy: "", + isActive: false, }; } -export const UpdateMBHeadRequest: MessageFns = { - encode(message: UpdateMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); - } - if (message.mbhMbCosting !== undefined) { - writer.uint32(18).string(message.mbhMbCosting); - } - if (message.mbhMgtName !== undefined) { - writer.uint32(26).string(message.mbhMgtName); - } - if (message.mbhDenier !== undefined) { - writer.uint32(33).double(message.mbhDenier); +export const MbCost: MessageFns = { + encode(message: MbCost, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbcId !== "") { + writer.uint32(10).string(message.mbcId); } - if (message.mbhFilament !== undefined) { - writer.uint32(40).int32(message.mbhFilament); + if (message.mbhId !== "") { + writer.uint32(18).string(message.mbhId); } - if (message.mbhDozing !== undefined) { - writer.uint32(49).double(message.mbhDozing); + if (message.period !== "") { + writer.uint32(26).string(message.period); } - if (message.mbhIsActive !== undefined) { - writer.uint32(56).bool(message.mbhIsActive); + if (message.costType !== "") { + writer.uint32(34).string(message.costType); } - if (message.mbhCheckStatus !== undefined) { - writer.uint32(66).string(message.mbhCheckStatus); + if (message.costValue !== "") { + writer.uint32(42).string(message.costValue); } - if (message.mbhStatus !== undefined) { - writer.uint32(74).string(message.mbhStatus); + if (message.sourceCpcId !== 0) { + writer.uint32(48).int64(message.sourceCpcId); } - if (message.mbhLdrPrsn !== undefined) { - writer.uint32(81).double(message.mbhLdrPrsn); + if (message.pushedAt !== "") { + writer.uint32(58).string(message.pushedAt); } - if (message.mbhFinalProduct !== undefined) { - writer.uint32(90).string(message.mbhFinalProduct); + if (message.pushedBy !== "") { + writer.uint32(66).string(message.pushedBy); } - if (message.mbhCode !== undefined) { - writer.uint32(98).string(message.mbhCode); + if (message.isActive !== false) { + writer.uint32(72).bool(message.isActive); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateMBHeadRequest { + decode(input: BinaryReader | Uint8Array, length?: number): MbCost { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateMBHeadRequest(); + const message = createBaseMbCost(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -12934,7 +22960,7 @@ export const UpdateMBHeadRequest: MessageFns = { break; } - message.mbhId = reader.string(); + message.mbcId = reader.string(); continue; } case 2: { @@ -12942,7 +22968,7 @@ export const UpdateMBHeadRequest: MessageFns = { break; } - message.mbhMbCosting = reader.string(); + message.mbhId = reader.string(); continue; } case 3: { @@ -12950,39 +22976,39 @@ export const UpdateMBHeadRequest: MessageFns = { break; } - message.mbhMgtName = reader.string(); + message.period = reader.string(); continue; } case 4: { - if (tag !== 33) { + if (tag !== 34) { break; } - message.mbhDenier = reader.double(); + message.costType = reader.string(); continue; } case 5: { - if (tag !== 40) { + if (tag !== 42) { break; } - message.mbhFilament = reader.int32(); + message.costValue = reader.string(); continue; } case 6: { - if (tag !== 49) { + if (tag !== 48) { break; } - message.mbhDozing = reader.double(); + message.sourceCpcId = longToNumber(reader.int64()); continue; } case 7: { - if (tag !== 56) { + if (tag !== 58) { break; } - message.mbhIsActive = reader.bool(); + message.pushedAt = reader.string(); continue; } case 8: { @@ -12990,196 +23016,172 @@ export const UpdateMBHeadRequest: MessageFns = { break; } - message.mbhCheckStatus = reader.string(); + message.pushedBy = reader.string(); continue; } case 9: { - if (tag !== 74) { - break; - } - - message.mbhStatus = reader.string(); - continue; - } - case 10: { - if (tag !== 81) { - break; - } - - message.mbhLdrPrsn = reader.double(); - continue; - } - case 11: { - if (tag !== 90) { - break; - } - - message.mbhFinalProduct = reader.string(); - continue; - } - case 12: { - if (tag !== 98) { + if (tag !== 72) { break; - } - - message.mbhCode = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): UpdateMBHeadRequest { - return { - mbhId: isSet(object.mbhId) - ? globalThis.String(object.mbhId) - : isSet(object.mbh_id) - ? globalThis.String(object.mbh_id) - : "", - mbhMbCosting: isSet(object.mbhMbCosting) - ? globalThis.String(object.mbhMbCosting) - : isSet(object.mbh_mb_costing) - ? globalThis.String(object.mbh_mb_costing) - : undefined, - mbhMgtName: isSet(object.mbhMgtName) - ? globalThis.String(object.mbhMgtName) - : isSet(object.mbh_mgt_name) - ? globalThis.String(object.mbh_mgt_name) - : undefined, - mbhDenier: isSet(object.mbhDenier) - ? globalThis.Number(object.mbhDenier) - : isSet(object.mbh_denier) - ? globalThis.Number(object.mbh_denier) - : undefined, - mbhFilament: isSet(object.mbhFilament) - ? globalThis.Number(object.mbhFilament) - : isSet(object.mbh_filament) - ? globalThis.Number(object.mbh_filament) - : undefined, - mbhDozing: isSet(object.mbhDozing) - ? globalThis.Number(object.mbhDozing) - : isSet(object.mbh_dozing) - ? globalThis.Number(object.mbh_dozing) - : undefined, - mbhIsActive: isSet(object.mbhIsActive) - ? globalThis.Boolean(object.mbhIsActive) - : isSet(object.mbh_is_active) - ? globalThis.Boolean(object.mbh_is_active) - : undefined, - mbhCheckStatus: isSet(object.mbhCheckStatus) - ? globalThis.String(object.mbhCheckStatus) - : isSet(object.mbh_check_status) - ? globalThis.String(object.mbh_check_status) - : undefined, - mbhStatus: isSet(object.mbhStatus) - ? globalThis.String(object.mbhStatus) - : isSet(object.mbh_status) - ? globalThis.String(object.mbh_status) - : undefined, - mbhLdrPrsn: isSet(object.mbhLdrPrsn) - ? globalThis.Number(object.mbhLdrPrsn) - : isSet(object.mbh_ldr_prsn) - ? globalThis.Number(object.mbh_ldr_prsn) - : undefined, - mbhFinalProduct: isSet(object.mbhFinalProduct) - ? globalThis.String(object.mbhFinalProduct) - : isSet(object.mbh_final_product) - ? globalThis.String(object.mbh_final_product) - : undefined, - mbhCode: isSet(object.mbhCode) - ? globalThis.String(object.mbhCode) - : isSet(object.mbh_code) - ? globalThis.String(object.mbh_code) - : undefined, + } + + message.isActive = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): MbCost { + return { + mbcId: isSet(object.mbcId) + ? globalThis.String(object.mbcId) + : isSet(object.mbc_id) + ? globalThis.String(object.mbc_id) + : "", + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + period: isSet(object.period) ? globalThis.String(object.period) : "", + costType: isSet(object.costType) + ? globalThis.String(object.costType) + : isSet(object.cost_type) + ? globalThis.String(object.cost_type) + : "", + costValue: isSet(object.costValue) + ? globalThis.String(object.costValue) + : isSet(object.cost_value) + ? globalThis.String(object.cost_value) + : "", + sourceCpcId: isSet(object.sourceCpcId) + ? globalThis.Number(object.sourceCpcId) + : isSet(object.source_cpc_id) + ? globalThis.Number(object.source_cpc_id) + : 0, + pushedAt: isSet(object.pushedAt) + ? globalThis.String(object.pushedAt) + : isSet(object.pushed_at) + ? globalThis.String(object.pushed_at) + : "", + pushedBy: isSet(object.pushedBy) + ? globalThis.String(object.pushedBy) + : isSet(object.pushed_by) + ? globalThis.String(object.pushed_by) + : "", + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, }; }, - toJSON(message: UpdateMBHeadRequest): unknown { + toJSON(message: MbCost): unknown { const obj: any = {}; + if (message.mbcId !== "") { + obj.mbcId = message.mbcId; + } if (message.mbhId !== "") { obj.mbhId = message.mbhId; } - if (message.mbhMbCosting !== undefined) { - obj.mbhMbCosting = message.mbhMbCosting; - } - if (message.mbhMgtName !== undefined) { - obj.mbhMgtName = message.mbhMgtName; - } - if (message.mbhDenier !== undefined) { - obj.mbhDenier = message.mbhDenier; - } - if (message.mbhFilament !== undefined) { - obj.mbhFilament = Math.round(message.mbhFilament); - } - if (message.mbhDozing !== undefined) { - obj.mbhDozing = message.mbhDozing; + if (message.period !== "") { + obj.period = message.period; } - if (message.mbhIsActive !== undefined) { - obj.mbhIsActive = message.mbhIsActive; + if (message.costType !== "") { + obj.costType = message.costType; } - if (message.mbhCheckStatus !== undefined) { - obj.mbhCheckStatus = message.mbhCheckStatus; + if (message.costValue !== "") { + obj.costValue = message.costValue; } - if (message.mbhStatus !== undefined) { - obj.mbhStatus = message.mbhStatus; + if (message.sourceCpcId !== 0) { + obj.sourceCpcId = Math.round(message.sourceCpcId); } - if (message.mbhLdrPrsn !== undefined) { - obj.mbhLdrPrsn = message.mbhLdrPrsn; + if (message.pushedAt !== "") { + obj.pushedAt = message.pushedAt; } - if (message.mbhFinalProduct !== undefined) { - obj.mbhFinalProduct = message.mbhFinalProduct; + if (message.pushedBy !== "") { + obj.pushedBy = message.pushedBy; } - if (message.mbhCode !== undefined) { - obj.mbhCode = message.mbhCode; + if (message.isActive !== false) { + obj.isActive = message.isActive; } return obj; }, - create(base?: DeepPartial): UpdateMBHeadRequest { - return UpdateMBHeadRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): MbCost { + return MbCost.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateMBHeadRequest { - const message = createBaseUpdateMBHeadRequest(); + fromPartial(object: DeepPartial): MbCost { + const message = createBaseMbCost(); + message.mbcId = object.mbcId ?? ""; message.mbhId = object.mbhId ?? ""; - message.mbhMbCosting = object.mbhMbCosting ?? undefined; - message.mbhMgtName = object.mbhMgtName ?? undefined; - message.mbhDenier = object.mbhDenier ?? undefined; - message.mbhFilament = object.mbhFilament ?? undefined; - message.mbhDozing = object.mbhDozing ?? undefined; - message.mbhIsActive = object.mbhIsActive ?? undefined; - message.mbhCheckStatus = object.mbhCheckStatus ?? undefined; - message.mbhStatus = object.mbhStatus ?? undefined; - message.mbhLdrPrsn = object.mbhLdrPrsn ?? undefined; - message.mbhFinalProduct = object.mbhFinalProduct ?? undefined; - message.mbhCode = object.mbhCode ?? undefined; + message.period = object.period ?? ""; + message.costType = object.costType ?? ""; + message.costValue = object.costValue ?? ""; + message.sourceCpcId = object.sourceCpcId ?? 0; + message.pushedAt = object.pushedAt ?? ""; + message.pushedBy = object.pushedBy ?? ""; + message.isActive = object.isActive ?? false; return message; }, }; -function createBaseUpdateMBHeadResponse(): UpdateMBHeadResponse { - return { base: undefined, data: undefined }; +function createBaseMbPushLog(): MbPushLog { + return { + mbplId: "", + period: "", + pushedAt: "", + pushedBy: "", + mbCount: 0, + rowCount: 0, + costTypes: "", + previousPeriod: "", + notes: "", + }; } -export const UpdateMBHeadResponse: MessageFns = { - encode(message: UpdateMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); +export const MbPushLog: MessageFns = { + encode(message: MbPushLog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbplId !== "") { + writer.uint32(10).string(message.mbplId); } - if (message.data !== undefined) { - MBHead.encode(message.data, writer.uint32(18).fork()).join(); + if (message.period !== "") { + writer.uint32(18).string(message.period); + } + if (message.pushedAt !== "") { + writer.uint32(26).string(message.pushedAt); + } + if (message.pushedBy !== "") { + writer.uint32(34).string(message.pushedBy); + } + if (message.mbCount !== 0) { + writer.uint32(40).int32(message.mbCount); + } + if (message.rowCount !== 0) { + writer.uint32(48).int32(message.rowCount); + } + if (message.costTypes !== "") { + writer.uint32(58).string(message.costTypes); + } + if (message.previousPeriod !== "") { + writer.uint32(66).string(message.previousPeriod); + } + if (message.notes !== "") { + writer.uint32(74).string(message.notes); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateMBHeadResponse { + decode(input: BinaryReader | Uint8Array, length?: number): MbPushLog { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateMBHeadResponse(); + const message = createBaseMbPushLog(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -13188,7 +23190,7 @@ export const UpdateMBHeadResponse: MessageFns = { break; } - message.base = BaseResponse.decode(reader, reader.uint32()); + message.mbplId = reader.string(); continue; } case 2: { @@ -13196,7 +23198,63 @@ export const UpdateMBHeadResponse: MessageFns = { break; } - message.data = MBHead.decode(reader, reader.uint32()); + message.period = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pushedAt = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.pushedBy = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.mbCount = reader.int32(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.rowCount = reader.int32(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } + + message.costTypes = reader.string(); + continue; + } + case 8: { + if (tag !== 66) { + break; + } + + message.previousPeriod = reader.string(); + continue; + } + case 9: { + if (tag !== 74) { + break; + } + + message.notes = reader.string(); continue; } } @@ -13208,53 +23266,135 @@ export const UpdateMBHeadResponse: MessageFns = { return message; }, - fromJSON(object: any): UpdateMBHeadResponse { + fromJSON(object: any): MbPushLog { return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? MBHead.fromJSON(object.data) : undefined, + mbplId: isSet(object.mbplId) + ? globalThis.String(object.mbplId) + : isSet(object.mbpl_id) + ? globalThis.String(object.mbpl_id) + : "", + period: isSet(object.period) ? globalThis.String(object.period) : "", + pushedAt: isSet(object.pushedAt) + ? globalThis.String(object.pushedAt) + : isSet(object.pushed_at) + ? globalThis.String(object.pushed_at) + : "", + pushedBy: isSet(object.pushedBy) + ? globalThis.String(object.pushedBy) + : isSet(object.pushed_by) + ? globalThis.String(object.pushed_by) + : "", + mbCount: isSet(object.mbCount) + ? globalThis.Number(object.mbCount) + : isSet(object.mb_count) + ? globalThis.Number(object.mb_count) + : 0, + rowCount: isSet(object.rowCount) + ? globalThis.Number(object.rowCount) + : isSet(object.row_count) + ? globalThis.Number(object.row_count) + : 0, + costTypes: isSet(object.costTypes) + ? globalThis.String(object.costTypes) + : isSet(object.cost_types) + ? globalThis.String(object.cost_types) + : "", + previousPeriod: isSet(object.previousPeriod) + ? globalThis.String(object.previousPeriod) + : isSet(object.previous_period) + ? globalThis.String(object.previous_period) + : "", + notes: isSet(object.notes) ? globalThis.String(object.notes) : "", }; }, - toJSON(message: UpdateMBHeadResponse): unknown { + toJSON(message: MbPushLog): unknown { const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); + if (message.mbplId !== "") { + obj.mbplId = message.mbplId; } - if (message.data !== undefined) { - obj.data = MBHead.toJSON(message.data); + if (message.period !== "") { + obj.period = message.period; + } + if (message.pushedAt !== "") { + obj.pushedAt = message.pushedAt; + } + if (message.pushedBy !== "") { + obj.pushedBy = message.pushedBy; + } + if (message.mbCount !== 0) { + obj.mbCount = Math.round(message.mbCount); + } + if (message.rowCount !== 0) { + obj.rowCount = Math.round(message.rowCount); + } + if (message.costTypes !== "") { + obj.costTypes = message.costTypes; + } + if (message.previousPeriod !== "") { + obj.previousPeriod = message.previousPeriod; + } + if (message.notes !== "") { + obj.notes = message.notes; } return obj; }, - create(base?: DeepPartial): UpdateMBHeadResponse { - return UpdateMBHeadResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): MbPushLog { + return MbPushLog.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateMBHeadResponse { - const message = createBaseUpdateMBHeadResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.data = (object.data !== undefined && object.data !== null) ? MBHead.fromPartial(object.data) : undefined; + fromPartial(object: DeepPartial): MbPushLog { + const message = createBaseMbPushLog(); + message.mbplId = object.mbplId ?? ""; + message.period = object.period ?? ""; + message.pushedAt = object.pushedAt ?? ""; + message.pushedBy = object.pushedBy ?? ""; + message.mbCount = object.mbCount ?? 0; + message.rowCount = object.rowCount ?? 0; + message.costTypes = object.costTypes ?? ""; + message.previousPeriod = object.previousPeriod ?? ""; + message.notes = object.notes ?? ""; return message; }, }; -function createBaseDeleteMBHeadRequest(): DeleteMBHeadRequest { - return { mbhId: "" }; +function createBaseMbWorkflowLog(): MbWorkflowLog { + return { mbwlId: "", mbhId: "", fromState: "", toState: "", actorUserId: "", actorAt: "", reason: "", version: 0 }; } -export const DeleteMBHeadRequest: MessageFns = { - encode(message: DeleteMBHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const MbWorkflowLog: MessageFns = { + encode(message: MbWorkflowLog, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbwlId !== "") { + writer.uint32(10).string(message.mbwlId); + } if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); + writer.uint32(18).string(message.mbhId); + } + if (message.fromState !== "") { + writer.uint32(26).string(message.fromState); + } + if (message.toState !== "") { + writer.uint32(34).string(message.toState); + } + if (message.actorUserId !== "") { + writer.uint32(42).string(message.actorUserId); + } + if (message.actorAt !== "") { + writer.uint32(50).string(message.actorAt); + } + if (message.reason !== "") { + writer.uint32(58).string(message.reason); + } + if (message.version !== 0) { + writer.uint32(64).int32(message.version); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteMBHeadRequest { + decode(input: BinaryReader | Uint8Array, length?: number): MbWorkflowLog { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteMBHeadRequest(); + const message = createBaseMbWorkflowLog(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -13263,71 +23403,63 @@ export const DeleteMBHeadRequest: MessageFns = { break; } - message.mbhId = reader.string(); + message.mbwlId = reader.string(); continue; } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, + case 2: { + if (tag !== 18) { + break; + } - fromJSON(object: any): DeleteMBHeadRequest { - return { - mbhId: isSet(object.mbhId) - ? globalThis.String(object.mbhId) - : isSet(object.mbh_id) - ? globalThis.String(object.mbh_id) - : "", - }; - }, + message.mbhId = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } - toJSON(message: DeleteMBHeadRequest): unknown { - const obj: any = {}; - if (message.mbhId !== "") { - obj.mbhId = message.mbhId; - } - return obj; - }, + message.fromState = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } - create(base?: DeepPartial): DeleteMBHeadRequest { - return DeleteMBHeadRequest.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): DeleteMBHeadRequest { - const message = createBaseDeleteMBHeadRequest(); - message.mbhId = object.mbhId ?? ""; - return message; - }, -}; + message.toState = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } -function createBaseDeleteMBHeadResponse(): DeleteMBHeadResponse { - return { base: undefined }; -} + message.actorUserId = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } -export const DeleteMBHeadResponse: MessageFns = { - encode(message: DeleteMBHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); - } - return writer; - }, + message.actorAt = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } - decode(input: BinaryReader | Uint8Array, length?: number): DeleteMBHeadResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteMBHeadResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { + message.reason = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { break; } - message.base = BaseResponse.decode(reader, reader.uint32()); + message.version = reader.int32(); continue; } } @@ -13339,70 +23471,132 @@ export const DeleteMBHeadResponse: MessageFns = { return message; }, - fromJSON(object: any): DeleteMBHeadResponse { - return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; + fromJSON(object: any): MbWorkflowLog { + return { + mbwlId: isSet(object.mbwlId) + ? globalThis.String(object.mbwlId) + : isSet(object.mbwl_id) + ? globalThis.String(object.mbwl_id) + : "", + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + fromState: isSet(object.fromState) + ? globalThis.String(object.fromState) + : isSet(object.from_state) + ? globalThis.String(object.from_state) + : "", + toState: isSet(object.toState) + ? globalThis.String(object.toState) + : isSet(object.to_state) + ? globalThis.String(object.to_state) + : "", + actorUserId: isSet(object.actorUserId) + ? globalThis.String(object.actorUserId) + : isSet(object.actor_user_id) + ? globalThis.String(object.actor_user_id) + : "", + actorAt: isSet(object.actorAt) + ? globalThis.String(object.actorAt) + : isSet(object.actor_at) + ? globalThis.String(object.actor_at) + : "", + reason: isSet(object.reason) ? globalThis.String(object.reason) : "", + version: isSet(object.version) ? globalThis.Number(object.version) : 0, + }; }, - toJSON(message: DeleteMBHeadResponse): unknown { + toJSON(message: MbWorkflowLog): unknown { const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); + if (message.mbwlId !== "") { + obj.mbwlId = message.mbwlId; + } + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; + } + if (message.fromState !== "") { + obj.fromState = message.fromState; + } + if (message.toState !== "") { + obj.toState = message.toState; + } + if (message.actorUserId !== "") { + obj.actorUserId = message.actorUserId; + } + if (message.actorAt !== "") { + obj.actorAt = message.actorAt; + } + if (message.reason !== "") { + obj.reason = message.reason; + } + if (message.version !== 0) { + obj.version = Math.round(message.version); } return obj; }, - create(base?: DeepPartial): DeleteMBHeadResponse { - return DeleteMBHeadResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): MbWorkflowLog { + return MbWorkflowLog.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteMBHeadResponse { - const message = createBaseDeleteMBHeadResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; + fromPartial(object: DeepPartial): MbWorkflowLog { + const message = createBaseMbWorkflowLog(); + message.mbwlId = object.mbwlId ?? ""; + message.mbhId = object.mbhId ?? ""; + message.fromState = object.fromState ?? ""; + message.toState = object.toState ?? ""; + message.actorUserId = object.actorUserId ?? ""; + message.actorAt = object.actorAt ?? ""; + message.reason = object.reason ?? ""; + message.version = object.version ?? 0; return message; }, }; -function createBaseListMBHeadsRequest(): ListMBHeadsRequest { - return { page: 0, pageSize: 0, search: "", activeFilter: 0, sortBy: "", sortOrder: "" }; +function createBaseCreateMbCompositionRequest(): CreateMbCompositionRequest { + return { mbhId: "", seqNo: 0, groupHeadId: "", compositionPct: "", sourceType: "", mbRefMbhId: "", isCarrier: false }; } -export const ListMBHeadsRequest: MessageFns = { - encode(message: ListMBHeadsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.page !== 0) { - writer.uint32(8).int32(message.page); +export const CreateMbCompositionRequest: MessageFns = { + encode(message: CreateMbCompositionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } - if (message.pageSize !== 0) { - writer.uint32(16).int32(message.pageSize); + if (message.seqNo !== 0) { + writer.uint32(16).int32(message.seqNo); } - if (message.search !== "") { - writer.uint32(26).string(message.search); + if (message.groupHeadId !== "") { + writer.uint32(26).string(message.groupHeadId); } - if (message.activeFilter !== 0) { - writer.uint32(32).int32(message.activeFilter); + if (message.compositionPct !== "") { + writer.uint32(34).string(message.compositionPct); } - if (message.sortBy !== "") { - writer.uint32(42).string(message.sortBy); + if (message.sourceType !== "") { + writer.uint32(42).string(message.sourceType); } - if (message.sortOrder !== "") { - writer.uint32(50).string(message.sortOrder); + if (message.mbRefMbhId !== "") { + writer.uint32(50).string(message.mbRefMbhId); + } + if (message.isCarrier !== false) { + writer.uint32(56).bool(message.isCarrier); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListMBHeadsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMbCompositionRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMBHeadsRequest(); + const message = createBaseCreateMbCompositionRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 8) { + if (tag !== 10) { break; } - message.page = reader.int32(); + message.mbhId = reader.string(); continue; } case 2: { @@ -13410,7 +23604,7 @@ export const ListMBHeadsRequest: MessageFns = { break; } - message.pageSize = reader.int32(); + message.seqNo = reader.int32(); continue; } case 3: { @@ -13418,15 +23612,15 @@ export const ListMBHeadsRequest: MessageFns = { break; } - message.search = reader.string(); + message.groupHeadId = reader.string(); continue; } case 4: { - if (tag !== 32) { + if (tag !== 34) { break; } - message.activeFilter = reader.int32() as any; + message.compositionPct = reader.string(); continue; } case 5: { @@ -13434,7 +23628,7 @@ export const ListMBHeadsRequest: MessageFns = { break; } - message.sortBy = reader.string(); + message.sourceType = reader.string(); continue; } case 6: { @@ -13442,7 +23636,15 @@ export const ListMBHeadsRequest: MessageFns = { break; } - message.sortOrder = reader.string(); + message.mbRefMbhId = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.isCarrier = reader.bool(); continue; } } @@ -13454,93 +23656,107 @@ export const ListMBHeadsRequest: MessageFns = { return message; }, - fromJSON(object: any): ListMBHeadsRequest { + fromJSON(object: any): CreateMbCompositionRequest { return { - page: isSet(object.page) ? globalThis.Number(object.page) : 0, - pageSize: isSet(object.pageSize) - ? globalThis.Number(object.pageSize) - : isSet(object.page_size) - ? globalThis.Number(object.page_size) - : 0, - search: isSet(object.search) ? globalThis.String(object.search) : "", - activeFilter: isSet(object.activeFilter) - ? activeFilterFromJSON(object.activeFilter) - : isSet(object.active_filter) - ? activeFilterFromJSON(object.active_filter) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + seqNo: isSet(object.seqNo) + ? globalThis.Number(object.seqNo) + : isSet(object.seq_no) + ? globalThis.Number(object.seq_no) : 0, - sortBy: isSet(object.sortBy) - ? globalThis.String(object.sortBy) - : isSet(object.sort_by) - ? globalThis.String(object.sort_by) + groupHeadId: isSet(object.groupHeadId) + ? globalThis.String(object.groupHeadId) + : isSet(object.group_head_id) + ? globalThis.String(object.group_head_id) : "", - sortOrder: isSet(object.sortOrder) - ? globalThis.String(object.sortOrder) - : isSet(object.sort_order) - ? globalThis.String(object.sort_order) + compositionPct: isSet(object.compositionPct) + ? globalThis.String(object.compositionPct) + : isSet(object.composition_pct) + ? globalThis.String(object.composition_pct) + : "", + sourceType: isSet(object.sourceType) + ? globalThis.String(object.sourceType) + : isSet(object.source_type) + ? globalThis.String(object.source_type) : "", + mbRefMbhId: isSet(object.mbRefMbhId) + ? globalThis.String(object.mbRefMbhId) + : isSet(object.mb_ref_mbh_id) + ? globalThis.String(object.mb_ref_mbh_id) + : "", + isCarrier: isSet(object.isCarrier) + ? globalThis.Boolean(object.isCarrier) + : isSet(object.is_carrier) + ? globalThis.Boolean(object.is_carrier) + : false, }; }, - toJSON(message: ListMBHeadsRequest): unknown { + toJSON(message: CreateMbCompositionRequest): unknown { const obj: any = {}; - if (message.page !== 0) { - obj.page = Math.round(message.page); + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } - if (message.pageSize !== 0) { - obj.pageSize = Math.round(message.pageSize); + if (message.seqNo !== 0) { + obj.seqNo = Math.round(message.seqNo); } - if (message.search !== "") { - obj.search = message.search; + if (message.groupHeadId !== "") { + obj.groupHeadId = message.groupHeadId; } - if (message.activeFilter !== 0) { - obj.activeFilter = activeFilterToJSON(message.activeFilter); + if (message.compositionPct !== "") { + obj.compositionPct = message.compositionPct; } - if (message.sortBy !== "") { - obj.sortBy = message.sortBy; + if (message.sourceType !== "") { + obj.sourceType = message.sourceType; } - if (message.sortOrder !== "") { - obj.sortOrder = message.sortOrder; + if (message.mbRefMbhId !== "") { + obj.mbRefMbhId = message.mbRefMbhId; + } + if (message.isCarrier !== false) { + obj.isCarrier = message.isCarrier; } return obj; }, - create(base?: DeepPartial): ListMBHeadsRequest { - return ListMBHeadsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMbCompositionRequest { + return CreateMbCompositionRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListMBHeadsRequest { - const message = createBaseListMBHeadsRequest(); - message.page = object.page ?? 0; - message.pageSize = object.pageSize ?? 0; - message.search = object.search ?? ""; - message.activeFilter = object.activeFilter ?? 0; - message.sortBy = object.sortBy ?? ""; - message.sortOrder = object.sortOrder ?? ""; + fromPartial(object: DeepPartial): CreateMbCompositionRequest { + const message = createBaseCreateMbCompositionRequest(); + message.mbhId = object.mbhId ?? ""; + message.seqNo = object.seqNo ?? 0; + message.groupHeadId = object.groupHeadId ?? ""; + message.compositionPct = object.compositionPct ?? ""; + message.sourceType = object.sourceType ?? ""; + message.mbRefMbhId = object.mbRefMbhId ?? ""; + message.isCarrier = object.isCarrier ?? false; return message; }, }; -function createBaseListMBHeadsResponse(): ListMBHeadsResponse { - return { base: undefined, data: [], pagination: undefined }; +function createBaseCreateMbCompositionResponse(): CreateMbCompositionResponse { + return { base: undefined, data: undefined }; } -export const ListMBHeadsResponse: MessageFns = { - encode(message: ListMBHeadsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const CreateMbCompositionResponse: MessageFns = { + encode(message: CreateMbCompositionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - for (const v of message.data) { - MBHead.encode(v!, writer.uint32(18).fork()).join(); - } - if (message.pagination !== undefined) { - PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); + if (message.data !== undefined) { + MbComposition.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListMBHeadsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMbCompositionResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMBHeadsResponse(); + const message = createBaseCreateMbCompositionResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -13557,15 +23773,7 @@ export const ListMBHeadsResponse: MessageFns = { break; } - message.data.push(MBHead.decode(reader, reader.uint32())); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.pagination = PaginationResponse.decode(reader, reader.uint32()); + message.data = MbComposition.decode(reader, reader.uint32()); continue; } } @@ -13577,69 +23785,119 @@ export const ListMBHeadsResponse: MessageFns = { return message; }, - fromJSON(object: any): ListMBHeadsResponse { + fromJSON(object: any): CreateMbCompositionResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MBHead.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, + data: isSet(object.data) ? MbComposition.fromJSON(object.data) : undefined, }; }, - toJSON(message: ListMBHeadsResponse): unknown { + toJSON(message: CreateMbCompositionResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data?.length) { - obj.data = message.data.map((e) => MBHead.toJSON(e)); - } - if (message.pagination !== undefined) { - obj.pagination = PaginationResponse.toJSON(message.pagination); + if (message.data !== undefined) { + obj.data = MbComposition.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): ListMBHeadsResponse { - return ListMBHeadsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMbCompositionResponse { + return CreateMbCompositionResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListMBHeadsResponse { - const message = createBaseListMBHeadsResponse(); + fromPartial(object: DeepPartial): CreateMbCompositionResponse { + const message = createBaseCreateMbCompositionResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = object.data?.map((e) => MBHead.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PaginationResponse.fromPartial(object.pagination) + message.data = (object.data !== undefined && object.data !== null) + ? MbComposition.fromPartial(object.data) : undefined; return message; }, }; -function createBaseExportMBHeadsRequest(): ExportMBHeadsRequest { - return { activeFilter: 0 }; +function createBaseUpdateMbCompositionRequest(): UpdateMbCompositionRequest { + return { mbcmId: "", compositionPct: "", groupHeadId: "", sourceType: "", mbRefMbhId: "", isCarrier: false }; } -export const ExportMBHeadsRequest: MessageFns = { - encode(message: ExportMBHeadsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.activeFilter !== 0) { - writer.uint32(8).int32(message.activeFilter); +export const UpdateMbCompositionRequest: MessageFns = { + encode(message: UpdateMbCompositionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbcmId !== "") { + writer.uint32(10).string(message.mbcmId); + } + if (message.compositionPct !== "") { + writer.uint32(18).string(message.compositionPct); + } + if (message.groupHeadId !== "") { + writer.uint32(26).string(message.groupHeadId); + } + if (message.sourceType !== "") { + writer.uint32(34).string(message.sourceType); + } + if (message.mbRefMbhId !== "") { + writer.uint32(42).string(message.mbRefMbhId); + } + if (message.isCarrier !== false) { + writer.uint32(48).bool(message.isCarrier); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportMBHeadsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportMBHeadsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMbCompositionRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateMbCompositionRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.mbcmId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.compositionPct = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.groupHeadId = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.sourceType = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.mbRefMbhId = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { break; } - message.activeFilter = reader.int32() as any; + message.isCarrier = reader.bool(); continue; } } @@ -13651,56 +23909,98 @@ export const ExportMBHeadsRequest: MessageFns = { return message; }, - fromJSON(object: any): ExportMBHeadsRequest { + fromJSON(object: any): UpdateMbCompositionRequest { return { - activeFilter: isSet(object.activeFilter) - ? activeFilterFromJSON(object.activeFilter) - : isSet(object.active_filter) - ? activeFilterFromJSON(object.active_filter) - : 0, + mbcmId: isSet(object.mbcmId) + ? globalThis.String(object.mbcmId) + : isSet(object.mbcm_id) + ? globalThis.String(object.mbcm_id) + : "", + compositionPct: isSet(object.compositionPct) + ? globalThis.String(object.compositionPct) + : isSet(object.composition_pct) + ? globalThis.String(object.composition_pct) + : "", + groupHeadId: isSet(object.groupHeadId) + ? globalThis.String(object.groupHeadId) + : isSet(object.group_head_id) + ? globalThis.String(object.group_head_id) + : "", + sourceType: isSet(object.sourceType) + ? globalThis.String(object.sourceType) + : isSet(object.source_type) + ? globalThis.String(object.source_type) + : "", + mbRefMbhId: isSet(object.mbRefMbhId) + ? globalThis.String(object.mbRefMbhId) + : isSet(object.mb_ref_mbh_id) + ? globalThis.String(object.mb_ref_mbh_id) + : "", + isCarrier: isSet(object.isCarrier) + ? globalThis.Boolean(object.isCarrier) + : isSet(object.is_carrier) + ? globalThis.Boolean(object.is_carrier) + : false, }; }, - toJSON(message: ExportMBHeadsRequest): unknown { + toJSON(message: UpdateMbCompositionRequest): unknown { const obj: any = {}; - if (message.activeFilter !== 0) { - obj.activeFilter = activeFilterToJSON(message.activeFilter); + if (message.mbcmId !== "") { + obj.mbcmId = message.mbcmId; + } + if (message.compositionPct !== "") { + obj.compositionPct = message.compositionPct; + } + if (message.groupHeadId !== "") { + obj.groupHeadId = message.groupHeadId; + } + if (message.sourceType !== "") { + obj.sourceType = message.sourceType; + } + if (message.mbRefMbhId !== "") { + obj.mbRefMbhId = message.mbRefMbhId; + } + if (message.isCarrier !== false) { + obj.isCarrier = message.isCarrier; } return obj; }, - create(base?: DeepPartial): ExportMBHeadsRequest { - return ExportMBHeadsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateMbCompositionRequest { + return UpdateMbCompositionRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportMBHeadsRequest { - const message = createBaseExportMBHeadsRequest(); - message.activeFilter = object.activeFilter ?? 0; + fromPartial(object: DeepPartial): UpdateMbCompositionRequest { + const message = createBaseUpdateMbCompositionRequest(); + message.mbcmId = object.mbcmId ?? ""; + message.compositionPct = object.compositionPct ?? ""; + message.groupHeadId = object.groupHeadId ?? ""; + message.sourceType = object.sourceType ?? ""; + message.mbRefMbhId = object.mbRefMbhId ?? ""; + message.isCarrier = object.isCarrier ?? false; return message; }, }; -function createBaseExportMBHeadsResponse(): ExportMBHeadsResponse { - return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +function createBaseUpdateMbCompositionResponse(): UpdateMbCompositionResponse { + return { base: undefined, data: undefined }; } -export const ExportMBHeadsResponse: MessageFns = { - encode(message: ExportMBHeadsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const UpdateMbCompositionResponse: MessageFns = { + encode(message: UpdateMbCompositionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.fileContent.length !== 0) { - writer.uint32(18).bytes(message.fileContent); - } - if (message.fileName !== "") { - writer.uint32(26).string(message.fileName); + if (message.data !== undefined) { + MbComposition.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportMBHeadsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMbCompositionResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportMBHeadsResponse(); + const message = createBaseUpdateMbCompositionResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -13717,15 +24017,7 @@ export const ExportMBHeadsResponse: MessageFns = { break; } - message.fileContent = reader.bytes(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.fileName = reader.string(); + message.data = MbComposition.decode(reader, reader.uint32()); continue; } } @@ -13737,72 +24029,55 @@ export const ExportMBHeadsResponse: MessageFns = { return message; }, - fromJSON(object: any): ExportMBHeadsResponse { + fromJSON(object: any): UpdateMbCompositionResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - fileContent: isSet(object.fileContent) - ? bytesFromBase64(object.fileContent) - : isSet(object.file_content) - ? bytesFromBase64(object.file_content) - : new Uint8Array(0), - fileName: isSet(object.fileName) - ? globalThis.String(object.fileName) - : isSet(object.file_name) - ? globalThis.String(object.file_name) - : "", + data: isSet(object.data) ? MbComposition.fromJSON(object.data) : undefined, }; }, - toJSON(message: ExportMBHeadsResponse): unknown { + toJSON(message: UpdateMbCompositionResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.fileContent.length !== 0) { - obj.fileContent = base64FromBytes(message.fileContent); - } - if (message.fileName !== "") { - obj.fileName = message.fileName; + if (message.data !== undefined) { + obj.data = MbComposition.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): ExportMBHeadsResponse { - return ExportMBHeadsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateMbCompositionResponse { + return UpdateMbCompositionResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportMBHeadsResponse { - const message = createBaseExportMBHeadsResponse(); + fromPartial(object: DeepPartial): UpdateMbCompositionResponse { + const message = createBaseUpdateMbCompositionResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; + message.data = (object.data !== undefined && object.data !== null) + ? MbComposition.fromPartial(object.data) + : undefined; return message; }, }; -function createBaseImportMBHeadsRequest(): ImportMBHeadsRequest { - return { fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; +function createBaseDeleteMbCompositionRequest(): DeleteMbCompositionRequest { + return { mbcmId: "" }; } -export const ImportMBHeadsRequest: MessageFns = { - encode(message: ImportMBHeadsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.fileContent.length !== 0) { - writer.uint32(10).bytes(message.fileContent); - } - if (message.fileName !== "") { - writer.uint32(18).string(message.fileName); - } - if (message.duplicateAction !== "") { - writer.uint32(26).string(message.duplicateAction); +export const DeleteMbCompositionRequest: MessageFns = { + encode(message: DeleteMbCompositionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbcmId !== "") { + writer.uint32(10).string(message.mbcmId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportMBHeadsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMbCompositionRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportMBHeadsRequest(); + const message = createBaseDeleteMbCompositionRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -13811,23 +24086,7 @@ export const ImportMBHeadsRequest: MessageFns = { break; } - message.fileContent = reader.bytes(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.fileName = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.duplicateAction = reader.string(); + message.mbcmId = reader.string(); continue; } } @@ -13839,80 +24098,50 @@ export const ImportMBHeadsRequest: MessageFns = { return message; }, - fromJSON(object: any): ImportMBHeadsRequest { + fromJSON(object: any): DeleteMbCompositionRequest { return { - fileContent: isSet(object.fileContent) - ? bytesFromBase64(object.fileContent) - : isSet(object.file_content) - ? bytesFromBase64(object.file_content) - : new Uint8Array(0), - fileName: isSet(object.fileName) - ? globalThis.String(object.fileName) - : isSet(object.file_name) - ? globalThis.String(object.file_name) - : "", - duplicateAction: isSet(object.duplicateAction) - ? globalThis.String(object.duplicateAction) - : isSet(object.duplicate_action) - ? globalThis.String(object.duplicate_action) + mbcmId: isSet(object.mbcmId) + ? globalThis.String(object.mbcmId) + : isSet(object.mbcm_id) + ? globalThis.String(object.mbcm_id) : "", }; }, - toJSON(message: ImportMBHeadsRequest): unknown { + toJSON(message: DeleteMbCompositionRequest): unknown { const obj: any = {}; - if (message.fileContent.length !== 0) { - obj.fileContent = base64FromBytes(message.fileContent); - } - if (message.fileName !== "") { - obj.fileName = message.fileName; - } - if (message.duplicateAction !== "") { - obj.duplicateAction = message.duplicateAction; + if (message.mbcmId !== "") { + obj.mbcmId = message.mbcmId; } return obj; }, - create(base?: DeepPartial): ImportMBHeadsRequest { - return ImportMBHeadsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMbCompositionRequest { + return DeleteMbCompositionRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ImportMBHeadsRequest { - const message = createBaseImportMBHeadsRequest(); - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; - message.duplicateAction = object.duplicateAction ?? ""; + fromPartial(object: DeepPartial): DeleteMbCompositionRequest { + const message = createBaseDeleteMbCompositionRequest(); + message.mbcmId = object.mbcmId ?? ""; return message; }, }; -function createBaseImportMBHeadsResponse(): ImportMBHeadsResponse { - return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; +function createBaseDeleteMbCompositionResponse(): DeleteMbCompositionResponse { + return { base: undefined }; } -export const ImportMBHeadsResponse: MessageFns = { - encode(message: ImportMBHeadsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DeleteMbCompositionResponse: MessageFns = { + encode(message: DeleteMbCompositionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.successCount !== 0) { - writer.uint32(16).int32(message.successCount); - } - if (message.skippedCount !== 0) { - writer.uint32(24).int32(message.skippedCount); - } - if (message.failedCount !== 0) { - writer.uint32(32).int32(message.failedCount); - } - for (const v of message.errors) { - ImportError.encode(v!, writer.uint32(42).fork()).join(); - } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportMBHeadsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMbCompositionResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportMBHeadsResponse(); + const message = createBaseDeleteMbCompositionResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -13924,38 +24153,6 @@ export const ImportMBHeadsResponse: MessageFns = { message.base = BaseResponse.decode(reader, reader.uint32()); continue; } - case 2: { - if (tag !== 16) { - break; - } - - message.successCount = reader.int32(); - continue; - } - case 3: { - if (tag !== 24) { - break; - } - - message.skippedCount = reader.int32(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.failedCount = reader.int32(); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.errors.push(ImportError.decode(reader, reader.uint32())); - continue; - } } if ((tag & 7) === 4 || tag === 0) { break; @@ -13965,80 +24162,57 @@ export const ImportMBHeadsResponse: MessageFns = { return message; }, - fromJSON(object: any): ImportMBHeadsResponse { - return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - successCount: isSet(object.successCount) - ? globalThis.Number(object.successCount) - : isSet(object.success_count) - ? globalThis.Number(object.success_count) - : 0, - skippedCount: isSet(object.skippedCount) - ? globalThis.Number(object.skippedCount) - : isSet(object.skipped_count) - ? globalThis.Number(object.skipped_count) - : 0, - failedCount: isSet(object.failedCount) - ? globalThis.Number(object.failedCount) - : isSet(object.failed_count) - ? globalThis.Number(object.failed_count) - : 0, - errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => ImportError.fromJSON(e)) : [], - }; + fromJSON(object: any): DeleteMbCompositionResponse { + return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; }, - toJSON(message: ImportMBHeadsResponse): unknown { + toJSON(message: DeleteMbCompositionResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.successCount !== 0) { - obj.successCount = Math.round(message.successCount); - } - if (message.skippedCount !== 0) { - obj.skippedCount = Math.round(message.skippedCount); - } - if (message.failedCount !== 0) { - obj.failedCount = Math.round(message.failedCount); - } - if (message.errors?.length) { - obj.errors = message.errors.map((e) => ImportError.toJSON(e)); - } return obj; }, - create(base?: DeepPartial): ImportMBHeadsResponse { - return ImportMBHeadsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMbCompositionResponse { + return DeleteMbCompositionResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ImportMBHeadsResponse { - const message = createBaseImportMBHeadsResponse(); + fromPartial(object: DeepPartial): DeleteMbCompositionResponse { + const message = createBaseDeleteMbCompositionResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.successCount = object.successCount ?? 0; - message.skippedCount = object.skippedCount ?? 0; - message.failedCount = object.failedCount ?? 0; - message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; return message; }, }; -function createBaseDownloadMBHeadTemplateRequest(): DownloadMBHeadTemplateRequest { - return {}; +function createBaseListMbCompositionsRequest(): ListMbCompositionsRequest { + return { mbhId: "" }; } -export const DownloadMBHeadTemplateRequest: MessageFns = { - encode(_: DownloadMBHeadTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListMbCompositionsRequest: MessageFns = { + encode(message: ListMbCompositionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DownloadMBHeadTemplateRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbCompositionsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDownloadMBHeadTemplateRequest(); + const message = createBaseListMbCompositionsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.mbhId = reader.string(); + continue; + } } if ((tag & 7) === 4 || tag === 0) { break; @@ -14048,46 +24222,53 @@ export const DownloadMBHeadTemplateRequest: MessageFns): DownloadMBHeadTemplateRequest { - return DownloadMBHeadTemplateRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMbCompositionsRequest { + return ListMbCompositionsRequest.fromPartial(base ?? {}); }, - fromPartial(_: DeepPartial): DownloadMBHeadTemplateRequest { - const message = createBaseDownloadMBHeadTemplateRequest(); + fromPartial(object: DeepPartial): ListMbCompositionsRequest { + const message = createBaseListMbCompositionsRequest(); + message.mbhId = object.mbhId ?? ""; return message; }, }; -function createBaseDownloadMBHeadTemplateResponse(): DownloadMBHeadTemplateResponse { - return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +function createBaseListMbCompositionsResponse(): ListMbCompositionsResponse { + return { base: undefined, data: [] }; } -export const DownloadMBHeadTemplateResponse: MessageFns = { - encode(message: DownloadMBHeadTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListMbCompositionsResponse: MessageFns = { + encode(message: ListMbCompositionsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.fileContent.length !== 0) { - writer.uint32(18).bytes(message.fileContent); - } - if (message.fileName !== "") { - writer.uint32(26).string(message.fileName); + for (const v of message.data) { + MbComposition.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DownloadMBHeadTemplateResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbCompositionsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDownloadMBHeadTemplateResponse(); + const message = createBaseListMbCompositionsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -14104,15 +24285,7 @@ export const DownloadMBHeadTemplateResponse: MessageFns MbComposition.fromJSON(e)) : [], }; }, - toJSON(message: DownloadMBHeadTemplateResponse): unknown { + toJSON(message: ListMbCompositionsResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.fileContent.length !== 0) { - obj.fileContent = base64FromBytes(message.fileContent); - } - if (message.fileName !== "") { - obj.fileName = message.fileName; + if (message.data?.length) { + obj.data = message.data.map((e) => MbComposition.toJSON(e)); } return obj; }, - create(base?: DeepPartial): DownloadMBHeadTemplateResponse { - return DownloadMBHeadTemplateResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMbCompositionsResponse { + return ListMbCompositionsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DownloadMBHeadTemplateResponse { - const message = createBaseDownloadMBHeadTemplateResponse(); + fromPartial(object: DeepPartial): ListMbCompositionsResponse { + const message = createBaseListMbCompositionsResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; + message.data = object.data?.map((e) => MbComposition.fromPartial(e)) || []; return message; }, }; -function createBaseMBSpin(): MBSpin { - return { - mbsId: "", - mbsOracleSysId: "", - mbsMbhId: "", - mbsMgtName: "", - mbsDenier: undefined, - mbsFilament: undefined, - mbsDozing: undefined, - mbsMbCosting: "", - mbsIsActive: false, - mbsCc: undefined, - mbsCostRateMkt: undefined, - mbsStatus: undefined, - mbsLdrPrsn: undefined, - mbsFinalProduct: undefined, - audit: undefined, - }; +function createBaseListMbCompositionVersionsRequest(): ListMbCompositionVersionsRequest { + return { mbhId: "", version: 0 }; } -export const MBSpin: MessageFns = { - encode(message: MBSpin, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbsId !== "") { - writer.uint32(10).string(message.mbsId); - } - if (message.mbsOracleSysId !== "") { - writer.uint32(18).string(message.mbsOracleSysId); - } - if (message.mbsMbhId !== "") { - writer.uint32(26).string(message.mbsMbhId); - } - if (message.mbsMgtName !== "") { - writer.uint32(34).string(message.mbsMgtName); - } - if (message.mbsDenier !== undefined) { - writer.uint32(41).double(message.mbsDenier); - } - if (message.mbsFilament !== undefined) { - writer.uint32(48).int32(message.mbsFilament); - } - if (message.mbsDozing !== undefined) { - writer.uint32(57).double(message.mbsDozing); - } - if (message.mbsMbCosting !== "") { - writer.uint32(66).string(message.mbsMbCosting); - } - if (message.mbsIsActive !== false) { - writer.uint32(72).bool(message.mbsIsActive); - } - if (message.mbsCc !== undefined) { - writer.uint32(82).string(message.mbsCc); - } - if (message.mbsCostRateMkt !== undefined) { - writer.uint32(89).double(message.mbsCostRateMkt); - } - if (message.mbsStatus !== undefined) { - writer.uint32(98).string(message.mbsStatus); - } - if (message.mbsLdrPrsn !== undefined) { - writer.uint32(105).double(message.mbsLdrPrsn); - } - if (message.mbsFinalProduct !== undefined) { - writer.uint32(114).string(message.mbsFinalProduct); +export const ListMbCompositionVersionsRequest: MessageFns = { + encode(message: ListMbCompositionVersionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } - if (message.audit !== undefined) { - AuditInfo.encode(message.audit, writer.uint32(130).fork()).join(); + if (message.version !== 0) { + writer.uint32(16).int32(message.version); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MBSpin { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbCompositionVersionsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMBSpin(); + const message = createBaseListMbCompositionVersionsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -14250,119 +24355,217 @@ export const MBSpin: MessageFns = { break; } - message.mbsId = reader.string(); + message.mbhId = reader.string(); continue; } case 2: { - if (tag !== 18) { + if (tag !== 16) { break; } - message.mbsOracleSysId = reader.string(); + message.version = reader.int32(); continue; } - case 3: { - if (tag !== 26) { - break; - } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, - message.mbsMbhId = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } + fromJSON(object: any): ListMbCompositionVersionsRequest { + return { + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + version: isSet(object.version) ? globalThis.Number(object.version) : 0, + }; + }, - message.mbsMgtName = reader.string(); - continue; - } - case 5: { - if (tag !== 41) { - break; - } + toJSON(message: ListMbCompositionVersionsRequest): unknown { + const obj: any = {}; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; + } + if (message.version !== 0) { + obj.version = Math.round(message.version); + } + return obj; + }, - message.mbsDenier = reader.double(); - continue; - } - case 6: { - if (tag !== 48) { + create(base?: DeepPartial): ListMbCompositionVersionsRequest { + return ListMbCompositionVersionsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListMbCompositionVersionsRequest { + const message = createBaseListMbCompositionVersionsRequest(); + message.mbhId = object.mbhId ?? ""; + message.version = object.version ?? 0; + return message; + }, +}; + +function createBaseListMbCompositionVersionsResponse(): ListMbCompositionVersionsResponse { + return { base: undefined, data: [] }; +} + +export const ListMbCompositionVersionsResponse: MessageFns = { + encode(message: ListMbCompositionVersionsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + for (const v of message.data) { + MbCompositionVersion.encode(v!, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): ListMbCompositionVersionsResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseListMbCompositionVersionsResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { break; } - message.mbsFilament = reader.int32(); + message.base = BaseResponse.decode(reader, reader.uint32()); continue; } - case 7: { - if (tag !== 57) { + case 2: { + if (tag !== 18) { break; } - message.mbsDozing = reader.double(); + message.data.push(MbCompositionVersion.decode(reader, reader.uint32())); continue; } - case 8: { - if (tag !== 66) { - break; - } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ListMbCompositionVersionsResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MbCompositionVersion.fromJSON(e)) : [], + }; + }, + + toJSON(message: ListMbCompositionVersionsResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data?.length) { + obj.data = message.data.map((e) => MbCompositionVersion.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ListMbCompositionVersionsResponse { + return ListMbCompositionVersionsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ListMbCompositionVersionsResponse { + const message = createBaseListMbCompositionVersionsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = object.data?.map((e) => MbCompositionVersion.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCreateMbLustureRequest(): CreateMbLustureRequest { + return { code: "", displayName: "", fullDescription: "", category: "", isActive: false, displayOrder: 0 }; +} - message.mbsMbCosting = reader.string(); - continue; - } - case 9: { - if (tag !== 72) { - break; - } +export const CreateMbLustureRequest: MessageFns = { + encode(message: CreateMbLustureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.code !== "") { + writer.uint32(10).string(message.code); + } + if (message.displayName !== "") { + writer.uint32(18).string(message.displayName); + } + if (message.fullDescription !== "") { + writer.uint32(26).string(message.fullDescription); + } + if (message.category !== "") { + writer.uint32(34).string(message.category); + } + if (message.isActive !== false) { + writer.uint32(40).bool(message.isActive); + } + if (message.displayOrder !== 0) { + writer.uint32(48).int32(message.displayOrder); + } + return writer; + }, - message.mbsIsActive = reader.bool(); - continue; - } - case 10: { - if (tag !== 82) { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMbLustureRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMbLustureRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { break; } - message.mbsCc = reader.string(); + message.code = reader.string(); continue; } - case 11: { - if (tag !== 89) { + case 2: { + if (tag !== 18) { break; } - message.mbsCostRateMkt = reader.double(); + message.displayName = reader.string(); continue; } - case 12: { - if (tag !== 98) { + case 3: { + if (tag !== 26) { break; } - message.mbsStatus = reader.string(); + message.fullDescription = reader.string(); continue; } - case 13: { - if (tag !== 105) { + case 4: { + if (tag !== 34) { break; } - message.mbsLdrPrsn = reader.double(); + message.category = reader.string(); continue; } - case 14: { - if (tag !== 114) { + case 5: { + if (tag !== 40) { break; } - message.mbsFinalProduct = reader.string(); + message.isActive = reader.bool(); continue; } - case 16: { - if (tag !== 130) { + case 6: { + if (tag !== 48) { break; } - message.audit = AuditInfo.decode(reader, reader.uint32()); + message.displayOrder = reader.int32(); continue; } } @@ -14374,220 +24577,180 @@ export const MBSpin: MessageFns = { return message; }, - fromJSON(object: any): MBSpin { + fromJSON(object: any): CreateMbLustureRequest { return { - mbsId: isSet(object.mbsId) - ? globalThis.String(object.mbsId) - : isSet(object.mbs_id) - ? globalThis.String(object.mbs_id) - : "", - mbsOracleSysId: isSet(object.mbsOracleSysId) - ? globalThis.String(object.mbsOracleSysId) - : isSet(object.mbs_oracle_sys_id) - ? globalThis.String(object.mbs_oracle_sys_id) - : "", - mbsMbhId: isSet(object.mbsMbhId) - ? globalThis.String(object.mbsMbhId) - : isSet(object.mbs_mbh_id) - ? globalThis.String(object.mbs_mbh_id) - : "", - mbsMgtName: isSet(object.mbsMgtName) - ? globalThis.String(object.mbsMgtName) - : isSet(object.mbs_mgt_name) - ? globalThis.String(object.mbs_mgt_name) + code: isSet(object.code) ? globalThis.String(object.code) : "", + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) : "", - mbsDenier: isSet(object.mbsDenier) - ? globalThis.Number(object.mbsDenier) - : isSet(object.mbs_denier) - ? globalThis.Number(object.mbs_denier) - : undefined, - mbsFilament: isSet(object.mbsFilament) - ? globalThis.Number(object.mbsFilament) - : isSet(object.mbs_filament) - ? globalThis.Number(object.mbs_filament) - : undefined, - mbsDozing: isSet(object.mbsDozing) - ? globalThis.Number(object.mbsDozing) - : isSet(object.mbs_dozing) - ? globalThis.Number(object.mbs_dozing) - : undefined, - mbsMbCosting: isSet(object.mbsMbCosting) - ? globalThis.String(object.mbsMbCosting) - : isSet(object.mbs_mb_costing) - ? globalThis.String(object.mbs_mb_costing) + fullDescription: isSet(object.fullDescription) + ? globalThis.String(object.fullDescription) + : isSet(object.full_description) + ? globalThis.String(object.full_description) : "", - mbsIsActive: isSet(object.mbsIsActive) - ? globalThis.Boolean(object.mbsIsActive) - : isSet(object.mbs_is_active) - ? globalThis.Boolean(object.mbs_is_active) + category: isSet(object.category) ? globalThis.String(object.category) : "", + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) : false, - mbsCc: isSet(object.mbsCc) - ? globalThis.String(object.mbsCc) - : isSet(object.mbs_cc) - ? globalThis.String(object.mbs_cc) - : undefined, - mbsCostRateMkt: isSet(object.mbsCostRateMkt) - ? globalThis.Number(object.mbsCostRateMkt) - : isSet(object.mbs_cost_rate_mkt) - ? globalThis.Number(object.mbs_cost_rate_mkt) - : undefined, - mbsStatus: isSet(object.mbsStatus) - ? globalThis.String(object.mbsStatus) - : isSet(object.mbs_status) - ? globalThis.String(object.mbs_status) - : undefined, - mbsLdrPrsn: isSet(object.mbsLdrPrsn) - ? globalThis.Number(object.mbsLdrPrsn) - : isSet(object.mbs_ldr_prsn) - ? globalThis.Number(object.mbs_ldr_prsn) - : undefined, - mbsFinalProduct: isSet(object.mbsFinalProduct) - ? globalThis.String(object.mbsFinalProduct) - : isSet(object.mbs_final_product) - ? globalThis.String(object.mbs_final_product) - : undefined, - audit: isSet(object.audit) ? AuditInfo.fromJSON(object.audit) : undefined, + displayOrder: isSet(object.displayOrder) + ? globalThis.Number(object.displayOrder) + : isSet(object.display_order) + ? globalThis.Number(object.display_order) + : 0, }; }, - toJSON(message: MBSpin): unknown { + toJSON(message: CreateMbLustureRequest): unknown { const obj: any = {}; - if (message.mbsId !== "") { - obj.mbsId = message.mbsId; - } - if (message.mbsOracleSysId !== "") { - obj.mbsOracleSysId = message.mbsOracleSysId; - } - if (message.mbsMbhId !== "") { - obj.mbsMbhId = message.mbsMbhId; - } - if (message.mbsMgtName !== "") { - obj.mbsMgtName = message.mbsMgtName; - } - if (message.mbsDenier !== undefined) { - obj.mbsDenier = message.mbsDenier; - } - if (message.mbsFilament !== undefined) { - obj.mbsFilament = Math.round(message.mbsFilament); - } - if (message.mbsDozing !== undefined) { - obj.mbsDozing = message.mbsDozing; - } - if (message.mbsMbCosting !== "") { - obj.mbsMbCosting = message.mbsMbCosting; - } - if (message.mbsIsActive !== false) { - obj.mbsIsActive = message.mbsIsActive; - } - if (message.mbsCc !== undefined) { - obj.mbsCc = message.mbsCc; + if (message.code !== "") { + obj.code = message.code; } - if (message.mbsCostRateMkt !== undefined) { - obj.mbsCostRateMkt = message.mbsCostRateMkt; + if (message.displayName !== "") { + obj.displayName = message.displayName; } - if (message.mbsStatus !== undefined) { - obj.mbsStatus = message.mbsStatus; + if (message.fullDescription !== "") { + obj.fullDescription = message.fullDescription; } - if (message.mbsLdrPrsn !== undefined) { - obj.mbsLdrPrsn = message.mbsLdrPrsn; + if (message.category !== "") { + obj.category = message.category; } - if (message.mbsFinalProduct !== undefined) { - obj.mbsFinalProduct = message.mbsFinalProduct; + if (message.isActive !== false) { + obj.isActive = message.isActive; } - if (message.audit !== undefined) { - obj.audit = AuditInfo.toJSON(message.audit); + if (message.displayOrder !== 0) { + obj.displayOrder = Math.round(message.displayOrder); } return obj; }, - create(base?: DeepPartial): MBSpin { - return MBSpin.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMbLustureRequest { + return CreateMbLustureRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): MBSpin { - const message = createBaseMBSpin(); - message.mbsId = object.mbsId ?? ""; - message.mbsOracleSysId = object.mbsOracleSysId ?? ""; - message.mbsMbhId = object.mbsMbhId ?? ""; - message.mbsMgtName = object.mbsMgtName ?? ""; - message.mbsDenier = object.mbsDenier ?? undefined; - message.mbsFilament = object.mbsFilament ?? undefined; - message.mbsDozing = object.mbsDozing ?? undefined; - message.mbsMbCosting = object.mbsMbCosting ?? ""; - message.mbsIsActive = object.mbsIsActive ?? false; - message.mbsCc = object.mbsCc ?? undefined; - message.mbsCostRateMkt = object.mbsCostRateMkt ?? undefined; - message.mbsStatus = object.mbsStatus ?? undefined; - message.mbsLdrPrsn = object.mbsLdrPrsn ?? undefined; - message.mbsFinalProduct = object.mbsFinalProduct ?? undefined; - message.audit = (object.audit !== undefined && object.audit !== null) - ? AuditInfo.fromPartial(object.audit) - : undefined; + fromPartial(object: DeepPartial): CreateMbLustureRequest { + const message = createBaseCreateMbLustureRequest(); + message.code = object.code ?? ""; + message.displayName = object.displayName ?? ""; + message.fullDescription = object.fullDescription ?? ""; + message.category = object.category ?? ""; + message.isActive = object.isActive ?? false; + message.displayOrder = object.displayOrder ?? 0; return message; }, }; -function createBaseCreateMBSpinRequest(): CreateMBSpinRequest { - return { - mbhId: "", - mbsMgtName: "", - mbsOracleSysId: undefined, - mbsDenier: undefined, - mbsFilament: undefined, - mbsDozing: undefined, - mbsMbCosting: undefined, - mbsCc: undefined, - mbsCostRateMkt: undefined, - mbsStatus: undefined, - mbsLdrPrsn: undefined, - mbsFinalProduct: undefined, - }; +function createBaseCreateMbLustureResponse(): CreateMbLustureResponse { + return { base: undefined, data: undefined }; } -export const CreateMBSpinRequest: MessageFns = { - encode(message: CreateMBSpinRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); - } - if (message.mbsMgtName !== "") { - writer.uint32(18).string(message.mbsMgtName); +export const CreateMbLustureResponse: MessageFns = { + encode(message: CreateMbLustureResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.mbsOracleSysId !== undefined) { - writer.uint32(26).string(message.mbsOracleSysId); + if (message.data !== undefined) { + MbLusture.encode(message.data, writer.uint32(18).fork()).join(); } - if (message.mbsDenier !== undefined) { - writer.uint32(33).double(message.mbsDenier); + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): CreateMbLustureResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateMbLustureResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = MbLusture.decode(reader, reader.uint32()); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } - if (message.mbsFilament !== undefined) { - writer.uint32(40).int32(message.mbsFilament); + return message; + }, + + fromJSON(object: any): CreateMbLustureResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? MbLusture.fromJSON(object.data) : undefined, + }; + }, + + toJSON(message: CreateMbLustureResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); } - if (message.mbsDozing !== undefined) { - writer.uint32(49).double(message.mbsDozing); + if (message.data !== undefined) { + obj.data = MbLusture.toJSON(message.data); } - if (message.mbsMbCosting !== undefined) { - writer.uint32(58).string(message.mbsMbCosting); + return obj; + }, + + create(base?: DeepPartial): CreateMbLustureResponse { + return CreateMbLustureResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): CreateMbLustureResponse { + const message = createBaseCreateMbLustureResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MbLusture.fromPartial(object.data) : undefined; + return message; + }, +}; + +function createBaseUpdateMbLustureRequest(): UpdateMbLustureRequest { + return { mblId: "", displayName: "", fullDescription: "", category: "", isActive: false, displayOrder: 0 }; +} + +export const UpdateMbLustureRequest: MessageFns = { + encode(message: UpdateMbLustureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mblId !== "") { + writer.uint32(10).string(message.mblId); } - if (message.mbsCc !== undefined) { - writer.uint32(66).string(message.mbsCc); + if (message.displayName !== "") { + writer.uint32(18).string(message.displayName); } - if (message.mbsCostRateMkt !== undefined) { - writer.uint32(73).double(message.mbsCostRateMkt); + if (message.fullDescription !== "") { + writer.uint32(26).string(message.fullDescription); } - if (message.mbsStatus !== undefined) { - writer.uint32(82).string(message.mbsStatus); + if (message.category !== "") { + writer.uint32(34).string(message.category); } - if (message.mbsLdrPrsn !== undefined) { - writer.uint32(89).double(message.mbsLdrPrsn); + if (message.isActive !== false) { + writer.uint32(40).bool(message.isActive); } - if (message.mbsFinalProduct !== undefined) { - writer.uint32(98).string(message.mbsFinalProduct); + if (message.displayOrder !== 0) { + writer.uint32(48).int32(message.displayOrder); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateMBSpinRequest { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMbLustureRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateMBSpinRequest(); + const message = createBaseUpdateMbLustureRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -14596,7 +24759,7 @@ export const CreateMBSpinRequest: MessageFns = { break; } - message.mbhId = reader.string(); + message.mblId = reader.string(); continue; } case 2: { @@ -14604,7 +24767,7 @@ export const CreateMBSpinRequest: MessageFns = { break; } - message.mbsMgtName = reader.string(); + message.displayName = reader.string(); continue; } case 3: { @@ -14612,15 +24775,15 @@ export const CreateMBSpinRequest: MessageFns = { break; } - message.mbsOracleSysId = reader.string(); + message.fullDescription = reader.string(); continue; } case 4: { - if (tag !== 33) { + if (tag !== 34) { break; } - message.mbsDenier = reader.double(); + message.category = reader.string(); continue; } case 5: { @@ -14628,63 +24791,131 @@ export const CreateMBSpinRequest: MessageFns = { break; } - message.mbsFilament = reader.int32(); + message.isActive = reader.bool(); continue; } case 6: { - if (tag !== 49) { + if (tag !== 48) { break; } - message.mbsDozing = reader.double(); + message.displayOrder = reader.int32(); continue; } - case 7: { - if (tag !== 58) { - break; - } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, - message.mbsMbCosting = reader.string(); - continue; - } - case 8: { - if (tag !== 66) { - break; - } + fromJSON(object: any): UpdateMbLustureRequest { + return { + mblId: isSet(object.mblId) + ? globalThis.String(object.mblId) + : isSet(object.mbl_id) + ? globalThis.String(object.mbl_id) + : "", + displayName: isSet(object.displayName) + ? globalThis.String(object.displayName) + : isSet(object.display_name) + ? globalThis.String(object.display_name) + : "", + fullDescription: isSet(object.fullDescription) + ? globalThis.String(object.fullDescription) + : isSet(object.full_description) + ? globalThis.String(object.full_description) + : "", + category: isSet(object.category) ? globalThis.String(object.category) : "", + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, + displayOrder: isSet(object.displayOrder) + ? globalThis.Number(object.displayOrder) + : isSet(object.display_order) + ? globalThis.Number(object.display_order) + : 0, + }; + }, - message.mbsCc = reader.string(); - continue; - } - case 9: { - if (tag !== 73) { - break; - } + toJSON(message: UpdateMbLustureRequest): unknown { + const obj: any = {}; + if (message.mblId !== "") { + obj.mblId = message.mblId; + } + if (message.displayName !== "") { + obj.displayName = message.displayName; + } + if (message.fullDescription !== "") { + obj.fullDescription = message.fullDescription; + } + if (message.category !== "") { + obj.category = message.category; + } + if (message.isActive !== false) { + obj.isActive = message.isActive; + } + if (message.displayOrder !== 0) { + obj.displayOrder = Math.round(message.displayOrder); + } + return obj; + }, - message.mbsCostRateMkt = reader.double(); - continue; - } - case 10: { - if (tag !== 82) { - break; - } + create(base?: DeepPartial): UpdateMbLustureRequest { + return UpdateMbLustureRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateMbLustureRequest { + const message = createBaseUpdateMbLustureRequest(); + message.mblId = object.mblId ?? ""; + message.displayName = object.displayName ?? ""; + message.fullDescription = object.fullDescription ?? ""; + message.category = object.category ?? ""; + message.isActive = object.isActive ?? false; + message.displayOrder = object.displayOrder ?? 0; + return message; + }, +}; - message.mbsStatus = reader.string(); - continue; - } - case 11: { - if (tag !== 89) { +function createBaseUpdateMbLustureResponse(): UpdateMbLustureResponse { + return { base: undefined, data: undefined }; +} + +export const UpdateMbLustureResponse: MessageFns = { + encode(message: UpdateMbLustureResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + MbLusture.encode(message.data, writer.uint32(18).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMbLustureResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateMbLustureResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { break; } - message.mbsLdrPrsn = reader.double(); + message.base = BaseResponse.decode(reader, reader.uint32()); continue; } - case 12: { - if (tag !== 98) { + case 2: { + if (tag !== 18) { break; } - message.mbsFinalProduct = reader.string(); + message.data = MbLusture.decode(reader, reader.uint32()); continue; } } @@ -14696,152 +24927,117 @@ export const CreateMBSpinRequest: MessageFns = { return message; }, - fromJSON(object: any): CreateMBSpinRequest { + fromJSON(object: any): UpdateMbLustureResponse { return { - mbhId: isSet(object.mbhId) - ? globalThis.String(object.mbhId) - : isSet(object.mbh_id) - ? globalThis.String(object.mbh_id) - : "", - mbsMgtName: isSet(object.mbsMgtName) - ? globalThis.String(object.mbsMgtName) - : isSet(object.mbs_mgt_name) - ? globalThis.String(object.mbs_mgt_name) - : "", - mbsOracleSysId: isSet(object.mbsOracleSysId) - ? globalThis.String(object.mbsOracleSysId) - : isSet(object.mbs_oracle_sys_id) - ? globalThis.String(object.mbs_oracle_sys_id) - : undefined, - mbsDenier: isSet(object.mbsDenier) - ? globalThis.Number(object.mbsDenier) - : isSet(object.mbs_denier) - ? globalThis.Number(object.mbs_denier) - : undefined, - mbsFilament: isSet(object.mbsFilament) - ? globalThis.Number(object.mbsFilament) - : isSet(object.mbs_filament) - ? globalThis.Number(object.mbs_filament) - : undefined, - mbsDozing: isSet(object.mbsDozing) - ? globalThis.Number(object.mbsDozing) - : isSet(object.mbs_dozing) - ? globalThis.Number(object.mbs_dozing) - : undefined, - mbsMbCosting: isSet(object.mbsMbCosting) - ? globalThis.String(object.mbsMbCosting) - : isSet(object.mbs_mb_costing) - ? globalThis.String(object.mbs_mb_costing) - : undefined, - mbsCc: isSet(object.mbsCc) - ? globalThis.String(object.mbsCc) - : isSet(object.mbs_cc) - ? globalThis.String(object.mbs_cc) - : undefined, - mbsCostRateMkt: isSet(object.mbsCostRateMkt) - ? globalThis.Number(object.mbsCostRateMkt) - : isSet(object.mbs_cost_rate_mkt) - ? globalThis.Number(object.mbs_cost_rate_mkt) - : undefined, - mbsStatus: isSet(object.mbsStatus) - ? globalThis.String(object.mbsStatus) - : isSet(object.mbs_status) - ? globalThis.String(object.mbs_status) - : undefined, - mbsLdrPrsn: isSet(object.mbsLdrPrsn) - ? globalThis.Number(object.mbsLdrPrsn) - : isSet(object.mbs_ldr_prsn) - ? globalThis.Number(object.mbs_ldr_prsn) - : undefined, - mbsFinalProduct: isSet(object.mbsFinalProduct) - ? globalThis.String(object.mbsFinalProduct) - : isSet(object.mbs_final_product) - ? globalThis.String(object.mbs_final_product) - : undefined, + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? MbLusture.fromJSON(object.data) : undefined, }; }, - toJSON(message: CreateMBSpinRequest): unknown { + toJSON(message: UpdateMbLustureResponse): unknown { const obj: any = {}; - if (message.mbhId !== "") { - obj.mbhId = message.mbhId; - } - if (message.mbsMgtName !== "") { - obj.mbsMgtName = message.mbsMgtName; - } - if (message.mbsOracleSysId !== undefined) { - obj.mbsOracleSysId = message.mbsOracleSysId; - } - if (message.mbsDenier !== undefined) { - obj.mbsDenier = message.mbsDenier; - } - if (message.mbsFilament !== undefined) { - obj.mbsFilament = Math.round(message.mbsFilament); - } - if (message.mbsDozing !== undefined) { - obj.mbsDozing = message.mbsDozing; - } - if (message.mbsMbCosting !== undefined) { - obj.mbsMbCosting = message.mbsMbCosting; - } - if (message.mbsCc !== undefined) { - obj.mbsCc = message.mbsCc; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); } - if (message.mbsCostRateMkt !== undefined) { - obj.mbsCostRateMkt = message.mbsCostRateMkt; + if (message.data !== undefined) { + obj.data = MbLusture.toJSON(message.data); } - if (message.mbsStatus !== undefined) { - obj.mbsStatus = message.mbsStatus; + return obj; + }, + + create(base?: DeepPartial): UpdateMbLustureResponse { + return UpdateMbLustureResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): UpdateMbLustureResponse { + const message = createBaseUpdateMbLustureResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MbLusture.fromPartial(object.data) : undefined; + return message; + }, +}; + +function createBaseDeleteMbLustureRequest(): DeleteMbLustureRequest { + return { mblId: "" }; +} + +export const DeleteMbLustureRequest: MessageFns = { + encode(message: DeleteMbLustureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mblId !== "") { + writer.uint32(10).string(message.mblId); } - if (message.mbsLdrPrsn !== undefined) { - obj.mbsLdrPrsn = message.mbsLdrPrsn; + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMbLustureRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteMbLustureRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.mblId = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); } - if (message.mbsFinalProduct !== undefined) { - obj.mbsFinalProduct = message.mbsFinalProduct; + return message; + }, + + fromJSON(object: any): DeleteMbLustureRequest { + return { + mblId: isSet(object.mblId) + ? globalThis.String(object.mblId) + : isSet(object.mbl_id) + ? globalThis.String(object.mbl_id) + : "", + }; + }, + + toJSON(message: DeleteMbLustureRequest): unknown { + const obj: any = {}; + if (message.mblId !== "") { + obj.mblId = message.mblId; } return obj; }, - create(base?: DeepPartial): CreateMBSpinRequest { - return CreateMBSpinRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMbLustureRequest { + return DeleteMbLustureRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateMBSpinRequest { - const message = createBaseCreateMBSpinRequest(); - message.mbhId = object.mbhId ?? ""; - message.mbsMgtName = object.mbsMgtName ?? ""; - message.mbsOracleSysId = object.mbsOracleSysId ?? undefined; - message.mbsDenier = object.mbsDenier ?? undefined; - message.mbsFilament = object.mbsFilament ?? undefined; - message.mbsDozing = object.mbsDozing ?? undefined; - message.mbsMbCosting = object.mbsMbCosting ?? undefined; - message.mbsCc = object.mbsCc ?? undefined; - message.mbsCostRateMkt = object.mbsCostRateMkt ?? undefined; - message.mbsStatus = object.mbsStatus ?? undefined; - message.mbsLdrPrsn = object.mbsLdrPrsn ?? undefined; - message.mbsFinalProduct = object.mbsFinalProduct ?? undefined; + fromPartial(object: DeepPartial): DeleteMbLustureRequest { + const message = createBaseDeleteMbLustureRequest(); + message.mblId = object.mblId ?? ""; return message; }, }; -function createBaseCreateMBSpinResponse(): CreateMBSpinResponse { - return { base: undefined, data: undefined }; +function createBaseDeleteMbLustureResponse(): DeleteMbLustureResponse { + return { base: undefined }; } -export const CreateMBSpinResponse: MessageFns = { - encode(message: CreateMBSpinResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DeleteMbLustureResponse: MessageFns = { + encode(message: DeleteMbLustureResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.data !== undefined) { - MBSpin.encode(message.data, writer.uint32(18).fork()).join(); - } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateMBSpinResponse { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMbLustureResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateMBSpinResponse(); + const message = createBaseDeleteMbLustureResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -14853,14 +25049,6 @@ export const CreateMBSpinResponse: MessageFns = { message.base = BaseResponse.decode(reader, reader.uint32()); continue; } - case 2: { - if (tag !== 18) { - break; - } - - message.data = MBSpin.decode(reader, reader.uint32()); - continue; - } } if ((tag & 7) === 4 || tag === 0) { break; @@ -14870,56 +25058,46 @@ export const CreateMBSpinResponse: MessageFns = { return message; }, - fromJSON(object: any): CreateMBSpinResponse { - return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? MBSpin.fromJSON(object.data) : undefined, - }; + fromJSON(object: any): DeleteMbLustureResponse { + return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; }, - toJSON(message: CreateMBSpinResponse): unknown { + toJSON(message: DeleteMbLustureResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data !== undefined) { - obj.data = MBSpin.toJSON(message.data); - } return obj; }, - create(base?: DeepPartial): CreateMBSpinResponse { - return CreateMBSpinResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMbLustureResponse { + return DeleteMbLustureResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateMBSpinResponse { - const message = createBaseCreateMBSpinResponse(); + fromPartial(object: DeepPartial): DeleteMbLustureResponse { + const message = createBaseDeleteMbLustureResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) ? MBSpin.fromPartial(object.data) : undefined; return message; }, }; -function createBaseGetMBSpinRequest(): GetMBSpinRequest { - return { mbhId: "", mbsId: "" }; +function createBaseGetMbLustureRequest(): GetMbLustureRequest { + return { mblId: "" }; } -export const GetMBSpinRequest: MessageFns = { - encode(message: GetMBSpinRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); - } - if (message.mbsId !== "") { - writer.uint32(18).string(message.mbsId); +export const GetMbLustureRequest: MessageFns = { + encode(message: GetMbLustureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mblId !== "") { + writer.uint32(10).string(message.mblId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetMBSpinRequest { + decode(input: BinaryReader | Uint8Array, length?: number): GetMbLustureRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetMBSpinRequest(); + const message = createBaseGetMbLustureRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -14928,15 +25106,7 @@ export const GetMBSpinRequest: MessageFns = { break; } - message.mbhId = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.mbsId = reader.string(); + message.mblId = reader.string(); continue; } } @@ -14948,62 +25118,53 @@ export const GetMBSpinRequest: MessageFns = { return message; }, - fromJSON(object: any): GetMBSpinRequest { + fromJSON(object: any): GetMbLustureRequest { return { - mbhId: isSet(object.mbhId) - ? globalThis.String(object.mbhId) - : isSet(object.mbh_id) - ? globalThis.String(object.mbh_id) - : "", - mbsId: isSet(object.mbsId) - ? globalThis.String(object.mbsId) - : isSet(object.mbs_id) - ? globalThis.String(object.mbs_id) + mblId: isSet(object.mblId) + ? globalThis.String(object.mblId) + : isSet(object.mbl_id) + ? globalThis.String(object.mbl_id) : "", }; }, - toJSON(message: GetMBSpinRequest): unknown { + toJSON(message: GetMbLustureRequest): unknown { const obj: any = {}; - if (message.mbhId !== "") { - obj.mbhId = message.mbhId; - } - if (message.mbsId !== "") { - obj.mbsId = message.mbsId; + if (message.mblId !== "") { + obj.mblId = message.mblId; } return obj; }, - create(base?: DeepPartial): GetMBSpinRequest { - return GetMBSpinRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): GetMbLustureRequest { + return GetMbLustureRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetMBSpinRequest { - const message = createBaseGetMBSpinRequest(); - message.mbhId = object.mbhId ?? ""; - message.mbsId = object.mbsId ?? ""; + fromPartial(object: DeepPartial): GetMbLustureRequest { + const message = createBaseGetMbLustureRequest(); + message.mblId = object.mblId ?? ""; return message; }, }; -function createBaseGetMBSpinResponse(): GetMBSpinResponse { +function createBaseGetMbLustureResponse(): GetMbLustureResponse { return { base: undefined, data: undefined }; } -export const GetMBSpinResponse: MessageFns = { - encode(message: GetMBSpinResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const GetMbLustureResponse: MessageFns = { + encode(message: GetMbLustureResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } if (message.data !== undefined) { - MBSpin.encode(message.data, writer.uint32(18).fork()).join(); + MbLusture.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetMBSpinResponse { + decode(input: BinaryReader | Uint8Array, length?: number): GetMbLustureResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetMBSpinResponse(); + const message = createBaseGetMbLustureResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -15020,7 +25181,7 @@ export const GetMBSpinResponse: MessageFns = { break; } - message.data = MBSpin.decode(reader, reader.uint32()); + message.data = MbLusture.decode(reader, reader.uint32()); continue; } } @@ -15032,208 +25193,117 @@ export const GetMBSpinResponse: MessageFns = { return message; }, - fromJSON(object: any): GetMBSpinResponse { + fromJSON(object: any): GetMbLustureResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? MBSpin.fromJSON(object.data) : undefined, + data: isSet(object.data) ? MbLusture.fromJSON(object.data) : undefined, }; }, - toJSON(message: GetMBSpinResponse): unknown { + toJSON(message: GetMbLustureResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data !== undefined) { - obj.data = MBSpin.toJSON(message.data); + obj.data = MbLusture.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): GetMBSpinResponse { - return GetMBSpinResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): GetMbLustureResponse { + return GetMbLustureResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetMBSpinResponse { - const message = createBaseGetMBSpinResponse(); + fromPartial(object: DeepPartial): GetMbLustureResponse { + const message = createBaseGetMbLustureResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) ? MBSpin.fromPartial(object.data) : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MbLusture.fromPartial(object.data) : undefined; return message; }, }; -function createBaseUpdateMBSpinRequest(): UpdateMBSpinRequest { - return { - mbhId: "", - mbsId: "", - mbsMgtName: undefined, - mbsDenier: undefined, - mbsFilament: undefined, - mbsDozing: undefined, - mbsMbCosting: undefined, - mbsIsActive: undefined, - mbsCc: undefined, - mbsCostRateMkt: undefined, - mbsStatus: undefined, - mbsLdrPrsn: undefined, - mbsFinalProduct: undefined, - }; +function createBaseListMbLustureRequest(): ListMbLustureRequest { + return { page: 0, pageSize: 0, search: "", sortBy: "", sortDir: "", activeFilter: 0 }; } -export const UpdateMBSpinRequest: MessageFns = { - encode(message: UpdateMBSpinRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); - } - if (message.mbsId !== "") { - writer.uint32(18).string(message.mbsId); - } - if (message.mbsMgtName !== undefined) { - writer.uint32(26).string(message.mbsMgtName); - } - if (message.mbsDenier !== undefined) { - writer.uint32(33).double(message.mbsDenier); - } - if (message.mbsFilament !== undefined) { - writer.uint32(40).int32(message.mbsFilament); - } - if (message.mbsDozing !== undefined) { - writer.uint32(49).double(message.mbsDozing); - } - if (message.mbsMbCosting !== undefined) { - writer.uint32(58).string(message.mbsMbCosting); - } - if (message.mbsIsActive !== undefined) { - writer.uint32(64).bool(message.mbsIsActive); +export const ListMbLustureRequest: MessageFns = { + encode(message: ListMbLustureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.page !== 0) { + writer.uint32(8).int32(message.page); } - if (message.mbsCc !== undefined) { - writer.uint32(74).string(message.mbsCc); + if (message.pageSize !== 0) { + writer.uint32(16).int32(message.pageSize); } - if (message.mbsCostRateMkt !== undefined) { - writer.uint32(81).double(message.mbsCostRateMkt); + if (message.search !== "") { + writer.uint32(26).string(message.search); } - if (message.mbsStatus !== undefined) { - writer.uint32(90).string(message.mbsStatus); + if (message.sortBy !== "") { + writer.uint32(34).string(message.sortBy); } - if (message.mbsLdrPrsn !== undefined) { - writer.uint32(97).double(message.mbsLdrPrsn); + if (message.sortDir !== "") { + writer.uint32(42).string(message.sortDir); } - if (message.mbsFinalProduct !== undefined) { - writer.uint32(106).string(message.mbsFinalProduct); + if (message.activeFilter !== 0) { + writer.uint32(48).int32(message.activeFilter); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateMBSpinRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbLustureRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateMBSpinRequest(); + const message = createBaseListMbLustureRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 10) { + if (tag !== 8) { break; } - message.mbhId = reader.string(); + message.page = reader.int32(); continue; } case 2: { - if (tag !== 18) { - break; - } - - message.mbsId = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.mbsMgtName = reader.string(); - continue; - } - case 4: { - if (tag !== 33) { - break; - } - - message.mbsDenier = reader.double(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.mbsFilament = reader.int32(); - continue; - } - case 6: { - if (tag !== 49) { - break; - } - - message.mbsDozing = reader.double(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.mbsMbCosting = reader.string(); - continue; - } - case 8: { - if (tag !== 64) { - break; - } - - message.mbsIsActive = reader.bool(); - continue; - } - case 9: { - if (tag !== 74) { + if (tag !== 16) { break; } - message.mbsCc = reader.string(); + message.pageSize = reader.int32(); continue; } - case 10: { - if (tag !== 81) { + case 3: { + if (tag !== 26) { break; } - message.mbsCostRateMkt = reader.double(); + message.search = reader.string(); continue; } - case 11: { - if (tag !== 90) { + case 4: { + if (tag !== 34) { break; } - message.mbsStatus = reader.string(); + message.sortBy = reader.string(); continue; } - case 12: { - if (tag !== 97) { + case 5: { + if (tag !== 42) { break; } - message.mbsLdrPrsn = reader.double(); + message.sortDir = reader.string(); continue; } - case 13: { - if (tag !== 106) { + case 6: { + if (tag !== 48) { break; } - message.mbsFinalProduct = reader.string(); + message.activeFilter = reader.int32() as any; continue; } } @@ -15245,161 +25315,93 @@ export const UpdateMBSpinRequest: MessageFns = { return message; }, - fromJSON(object: any): UpdateMBSpinRequest { + fromJSON(object: any): ListMbLustureRequest { return { - mbhId: isSet(object.mbhId) - ? globalThis.String(object.mbhId) - : isSet(object.mbh_id) - ? globalThis.String(object.mbh_id) + page: isSet(object.page) ? globalThis.Number(object.page) : 0, + pageSize: isSet(object.pageSize) + ? globalThis.Number(object.pageSize) + : isSet(object.page_size) + ? globalThis.Number(object.page_size) + : 0, + search: isSet(object.search) ? globalThis.String(object.search) : "", + sortBy: isSet(object.sortBy) + ? globalThis.String(object.sortBy) + : isSet(object.sort_by) + ? globalThis.String(object.sort_by) : "", - mbsId: isSet(object.mbsId) - ? globalThis.String(object.mbsId) - : isSet(object.mbs_id) - ? globalThis.String(object.mbs_id) + sortDir: isSet(object.sortDir) + ? globalThis.String(object.sortDir) + : isSet(object.sort_dir) + ? globalThis.String(object.sort_dir) : "", - mbsMgtName: isSet(object.mbsMgtName) - ? globalThis.String(object.mbsMgtName) - : isSet(object.mbs_mgt_name) - ? globalThis.String(object.mbs_mgt_name) - : undefined, - mbsDenier: isSet(object.mbsDenier) - ? globalThis.Number(object.mbsDenier) - : isSet(object.mbs_denier) - ? globalThis.Number(object.mbs_denier) - : undefined, - mbsFilament: isSet(object.mbsFilament) - ? globalThis.Number(object.mbsFilament) - : isSet(object.mbs_filament) - ? globalThis.Number(object.mbs_filament) - : undefined, - mbsDozing: isSet(object.mbsDozing) - ? globalThis.Number(object.mbsDozing) - : isSet(object.mbs_dozing) - ? globalThis.Number(object.mbs_dozing) - : undefined, - mbsMbCosting: isSet(object.mbsMbCosting) - ? globalThis.String(object.mbsMbCosting) - : isSet(object.mbs_mb_costing) - ? globalThis.String(object.mbs_mb_costing) - : undefined, - mbsIsActive: isSet(object.mbsIsActive) - ? globalThis.Boolean(object.mbsIsActive) - : isSet(object.mbs_is_active) - ? globalThis.Boolean(object.mbs_is_active) - : undefined, - mbsCc: isSet(object.mbsCc) - ? globalThis.String(object.mbsCc) - : isSet(object.mbs_cc) - ? globalThis.String(object.mbs_cc) - : undefined, - mbsCostRateMkt: isSet(object.mbsCostRateMkt) - ? globalThis.Number(object.mbsCostRateMkt) - : isSet(object.mbs_cost_rate_mkt) - ? globalThis.Number(object.mbs_cost_rate_mkt) - : undefined, - mbsStatus: isSet(object.mbsStatus) - ? globalThis.String(object.mbsStatus) - : isSet(object.mbs_status) - ? globalThis.String(object.mbs_status) - : undefined, - mbsLdrPrsn: isSet(object.mbsLdrPrsn) - ? globalThis.Number(object.mbsLdrPrsn) - : isSet(object.mbs_ldr_prsn) - ? globalThis.Number(object.mbs_ldr_prsn) - : undefined, - mbsFinalProduct: isSet(object.mbsFinalProduct) - ? globalThis.String(object.mbsFinalProduct) - : isSet(object.mbs_final_product) - ? globalThis.String(object.mbs_final_product) - : undefined, + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, }; }, - toJSON(message: UpdateMBSpinRequest): unknown { + toJSON(message: ListMbLustureRequest): unknown { const obj: any = {}; - if (message.mbhId !== "") { - obj.mbhId = message.mbhId; - } - if (message.mbsId !== "") { - obj.mbsId = message.mbsId; - } - if (message.mbsMgtName !== undefined) { - obj.mbsMgtName = message.mbsMgtName; - } - if (message.mbsDenier !== undefined) { - obj.mbsDenier = message.mbsDenier; - } - if (message.mbsFilament !== undefined) { - obj.mbsFilament = Math.round(message.mbsFilament); - } - if (message.mbsDozing !== undefined) { - obj.mbsDozing = message.mbsDozing; - } - if (message.mbsMbCosting !== undefined) { - obj.mbsMbCosting = message.mbsMbCosting; - } - if (message.mbsIsActive !== undefined) { - obj.mbsIsActive = message.mbsIsActive; + if (message.page !== 0) { + obj.page = Math.round(message.page); } - if (message.mbsCc !== undefined) { - obj.mbsCc = message.mbsCc; + if (message.pageSize !== 0) { + obj.pageSize = Math.round(message.pageSize); } - if (message.mbsCostRateMkt !== undefined) { - obj.mbsCostRateMkt = message.mbsCostRateMkt; + if (message.search !== "") { + obj.search = message.search; } - if (message.mbsStatus !== undefined) { - obj.mbsStatus = message.mbsStatus; + if (message.sortBy !== "") { + obj.sortBy = message.sortBy; } - if (message.mbsLdrPrsn !== undefined) { - obj.mbsLdrPrsn = message.mbsLdrPrsn; + if (message.sortDir !== "") { + obj.sortDir = message.sortDir; } - if (message.mbsFinalProduct !== undefined) { - obj.mbsFinalProduct = message.mbsFinalProduct; + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); } return obj; }, - create(base?: DeepPartial): UpdateMBSpinRequest { - return UpdateMBSpinRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMbLustureRequest { + return ListMbLustureRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateMBSpinRequest { - const message = createBaseUpdateMBSpinRequest(); - message.mbhId = object.mbhId ?? ""; - message.mbsId = object.mbsId ?? ""; - message.mbsMgtName = object.mbsMgtName ?? undefined; - message.mbsDenier = object.mbsDenier ?? undefined; - message.mbsFilament = object.mbsFilament ?? undefined; - message.mbsDozing = object.mbsDozing ?? undefined; - message.mbsMbCosting = object.mbsMbCosting ?? undefined; - message.mbsIsActive = object.mbsIsActive ?? undefined; - message.mbsCc = object.mbsCc ?? undefined; - message.mbsCostRateMkt = object.mbsCostRateMkt ?? undefined; - message.mbsStatus = object.mbsStatus ?? undefined; - message.mbsLdrPrsn = object.mbsLdrPrsn ?? undefined; - message.mbsFinalProduct = object.mbsFinalProduct ?? undefined; + fromPartial(object: DeepPartial): ListMbLustureRequest { + const message = createBaseListMbLustureRequest(); + message.page = object.page ?? 0; + message.pageSize = object.pageSize ?? 0; + message.search = object.search ?? ""; + message.sortBy = object.sortBy ?? ""; + message.sortDir = object.sortDir ?? ""; + message.activeFilter = object.activeFilter ?? 0; return message; }, }; -function createBaseUpdateMBSpinResponse(): UpdateMBSpinResponse { - return { base: undefined, data: undefined }; +function createBaseListMbLustureResponse(): ListMbLustureResponse { + return { base: undefined, data: [], pagination: undefined }; } -export const UpdateMBSpinResponse: MessageFns = { - encode(message: UpdateMBSpinResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListMbLustureResponse: MessageFns = { + encode(message: ListMbLustureResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.data !== undefined) { - MBSpin.encode(message.data, writer.uint32(18).fork()).join(); + for (const v of message.data) { + MbLusture.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.pagination !== undefined) { + PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateMBSpinResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbLustureResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateMBSpinResponse(); + const message = createBaseListMbLustureResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -15416,7 +25418,15 @@ export const UpdateMBSpinResponse: MessageFns = { break; } - message.data = MBSpin.decode(reader, reader.uint32()); + message.data.push(MbLusture.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pagination = PaginationResponse.decode(reader, reader.uint32()); continue; } } @@ -15428,137 +25438,130 @@ export const UpdateMBSpinResponse: MessageFns = { return message; }, - fromJSON(object: any): UpdateMBSpinResponse { + fromJSON(object: any): ListMbLustureResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? MBSpin.fromJSON(object.data) : undefined, + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MbLusture.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: UpdateMBSpinResponse): unknown { + toJSON(message: ListMbLustureResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data !== undefined) { - obj.data = MBSpin.toJSON(message.data); + if (message.data?.length) { + obj.data = message.data.map((e) => MbLusture.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PaginationResponse.toJSON(message.pagination); } return obj; }, - create(base?: DeepPartial): UpdateMBSpinResponse { - return UpdateMBSpinResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMbLustureResponse { + return ListMbLustureResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateMBSpinResponse { - const message = createBaseUpdateMBSpinResponse(); + fromPartial(object: DeepPartial): ListMbLustureResponse { + const message = createBaseListMbLustureResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) ? MBSpin.fromPartial(object.data) : undefined; + message.data = object.data?.map((e) => MbLusture.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PaginationResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseDeleteMBSpinRequest(): DeleteMBSpinRequest { - return { mbhId: "", mbsId: "" }; +function createBaseExportMbLustureRequest(): ExportMbLustureRequest { + return { activeFilter: 0 }; } -export const DeleteMBSpinRequest: MessageFns = { - encode(message: DeleteMBSpinRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); - } - if (message.mbsId !== "") { - writer.uint32(18).string(message.mbsId); +export const ExportMbLustureRequest: MessageFns = { + encode(message: ExportMbLustureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.activeFilter !== 0) { + writer.uint32(8).int32(message.activeFilter); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteMBSpinRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ExportMbLustureRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteMBSpinRequest(); + const message = createBaseExportMbLustureRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 10) { - break; - } - - message.mbhId = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { + if (tag !== 8) { break; } - message.mbsId = reader.string(); + message.activeFilter = reader.int32() as any; continue; } } if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): DeleteMBSpinRequest { - return { - mbhId: isSet(object.mbhId) - ? globalThis.String(object.mbhId) - : isSet(object.mbh_id) - ? globalThis.String(object.mbh_id) - : "", - mbsId: isSet(object.mbsId) - ? globalThis.String(object.mbsId) - : isSet(object.mbs_id) - ? globalThis.String(object.mbs_id) - : "", + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ExportMbLustureRequest { + return { + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, }; }, - toJSON(message: DeleteMBSpinRequest): unknown { + toJSON(message: ExportMbLustureRequest): unknown { const obj: any = {}; - if (message.mbhId !== "") { - obj.mbhId = message.mbhId; - } - if (message.mbsId !== "") { - obj.mbsId = message.mbsId; + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); } return obj; }, - create(base?: DeepPartial): DeleteMBSpinRequest { - return DeleteMBSpinRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ExportMbLustureRequest { + return ExportMbLustureRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteMBSpinRequest { - const message = createBaseDeleteMBSpinRequest(); - message.mbhId = object.mbhId ?? ""; - message.mbsId = object.mbsId ?? ""; + fromPartial(object: DeepPartial): ExportMbLustureRequest { + const message = createBaseExportMbLustureRequest(); + message.activeFilter = object.activeFilter ?? 0; return message; }, }; -function createBaseDeleteMBSpinResponse(): DeleteMBSpinResponse { - return { base: undefined }; +function createBaseExportMbLustureResponse(): ExportMbLustureResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; } -export const DeleteMBSpinResponse: MessageFns = { - encode(message: DeleteMBSpinResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ExportMbLustureResponse: MessageFns = { + encode(message: ExportMbLustureResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteMBSpinResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ExportMbLustureResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteMBSpinResponse(); + const message = createBaseExportMbLustureResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -15570,6 +25573,22 @@ export const DeleteMBSpinResponse: MessageFns = { message.base = BaseResponse.decode(reader, reader.uint32()); continue; } + case 2: { + if (tag !== 18) { + break; + } + + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); + continue; + } } if ((tag & 7) === 4 || tag === 0) { break; @@ -15579,64 +25598,72 @@ export const DeleteMBSpinResponse: MessageFns = { return message; }, - fromJSON(object: any): DeleteMBSpinResponse { - return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; + fromJSON(object: any): ExportMbLustureResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + }; }, - toJSON(message: DeleteMBSpinResponse): unknown { + toJSON(message: ExportMbLustureResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; + } return obj; }, - create(base?: DeepPartial): DeleteMBSpinResponse { - return DeleteMBSpinResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ExportMbLustureResponse { + return ExportMbLustureResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteMBSpinResponse { - const message = createBaseDeleteMBSpinResponse(); + fromPartial(object: DeepPartial): ExportMbLustureResponse { + const message = createBaseExportMbLustureResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; return message; }, }; -function createBaseListMBSpinsRequest(): ListMBSpinsRequest { - return { mbhId: "", page: 0, pageSize: 0, search: "", activeFilter: 0, sortBy: "", sortOrder: "" }; +function createBaseImportMbLustureRequest(): ImportMbLustureRequest { + return { fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; } -export const ListMBSpinsRequest: MessageFns = { - encode(message: ListMBSpinsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); - } - if (message.page !== 0) { - writer.uint32(16).int32(message.page); - } - if (message.pageSize !== 0) { - writer.uint32(24).int32(message.pageSize); - } - if (message.search !== "") { - writer.uint32(34).string(message.search); - } - if (message.activeFilter !== 0) { - writer.uint32(40).int32(message.activeFilter); +export const ImportMbLustureRequest: MessageFns = { + encode(message: ImportMbLustureRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.fileContent.length !== 0) { + writer.uint32(10).bytes(message.fileContent); } - if (message.sortBy !== "") { - writer.uint32(50).string(message.sortBy); + if (message.fileName !== "") { + writer.uint32(18).string(message.fileName); } - if (message.sortOrder !== "") { - writer.uint32(58).string(message.sortOrder); + if (message.duplicateAction !== "") { + writer.uint32(26).string(message.duplicateAction); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListMBSpinsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ImportMbLustureRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMBSpinsRequest(); + const message = createBaseImportMbLustureRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -15645,55 +25672,23 @@ export const ListMBSpinsRequest: MessageFns = { break; } - message.mbhId = reader.string(); + message.fileContent = reader.bytes(); continue; } case 2: { - if (tag !== 16) { + if (tag !== 18) { break; } - message.page = reader.int32(); + message.fileName = reader.string(); continue; } case 3: { - if (tag !== 24) { - break; - } - - message.pageSize = reader.int32(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.search = reader.string(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.activeFilter = reader.int32() as any; - continue; - } - case 6: { - if (tag !== 50) { - break; - } - - message.sortBy = reader.string(); - continue; - } - case 7: { - if (tag !== 58) { + if (tag !== 26) { break; } - message.sortOrder = reader.string(); + message.duplicateAction = reader.string(); continue; } } @@ -15705,102 +25700,80 @@ export const ListMBSpinsRequest: MessageFns = { return message; }, - fromJSON(object: any): ListMBSpinsRequest { + fromJSON(object: any): ImportMbLustureRequest { return { - mbhId: isSet(object.mbhId) - ? globalThis.String(object.mbhId) - : isSet(object.mbh_id) - ? globalThis.String(object.mbh_id) - : "", - page: isSet(object.page) ? globalThis.Number(object.page) : 0, - pageSize: isSet(object.pageSize) - ? globalThis.Number(object.pageSize) - : isSet(object.page_size) - ? globalThis.Number(object.page_size) - : 0, - search: isSet(object.search) ? globalThis.String(object.search) : "", - activeFilter: isSet(object.activeFilter) - ? activeFilterFromJSON(object.activeFilter) - : isSet(object.active_filter) - ? activeFilterFromJSON(object.active_filter) - : 0, - sortBy: isSet(object.sortBy) - ? globalThis.String(object.sortBy) - : isSet(object.sort_by) - ? globalThis.String(object.sort_by) + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) : "", - sortOrder: isSet(object.sortOrder) - ? globalThis.String(object.sortOrder) - : isSet(object.sort_order) - ? globalThis.String(object.sort_order) + duplicateAction: isSet(object.duplicateAction) + ? globalThis.String(object.duplicateAction) + : isSet(object.duplicate_action) + ? globalThis.String(object.duplicate_action) : "", }; }, - toJSON(message: ListMBSpinsRequest): unknown { + toJSON(message: ImportMbLustureRequest): unknown { const obj: any = {}; - if (message.mbhId !== "") { - obj.mbhId = message.mbhId; - } - if (message.page !== 0) { - obj.page = Math.round(message.page); - } - if (message.pageSize !== 0) { - obj.pageSize = Math.round(message.pageSize); - } - if (message.search !== "") { - obj.search = message.search; - } - if (message.activeFilter !== 0) { - obj.activeFilter = activeFilterToJSON(message.activeFilter); + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); } - if (message.sortBy !== "") { - obj.sortBy = message.sortBy; + if (message.fileName !== "") { + obj.fileName = message.fileName; } - if (message.sortOrder !== "") { - obj.sortOrder = message.sortOrder; + if (message.duplicateAction !== "") { + obj.duplicateAction = message.duplicateAction; } return obj; }, - create(base?: DeepPartial): ListMBSpinsRequest { - return ListMBSpinsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ImportMbLustureRequest { + return ImportMbLustureRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListMBSpinsRequest { - const message = createBaseListMBSpinsRequest(); - message.mbhId = object.mbhId ?? ""; - message.page = object.page ?? 0; - message.pageSize = object.pageSize ?? 0; - message.search = object.search ?? ""; - message.activeFilter = object.activeFilter ?? 0; - message.sortBy = object.sortBy ?? ""; - message.sortOrder = object.sortOrder ?? ""; + fromPartial(object: DeepPartial): ImportMbLustureRequest { + const message = createBaseImportMbLustureRequest(); + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + message.duplicateAction = object.duplicateAction ?? ""; return message; }, }; -function createBaseListMBSpinsResponse(): ListMBSpinsResponse { - return { base: undefined, data: [], pagination: undefined }; +function createBaseImportMbLustureResponse(): ImportMbLustureResponse { + return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; } -export const ListMBSpinsResponse: MessageFns = { - encode(message: ListMBSpinsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ImportMbLustureResponse: MessageFns = { + encode(message: ImportMbLustureResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - for (const v of message.data) { - MBSpin.encode(v!, writer.uint32(18).fork()).join(); + if (message.successCount !== 0) { + writer.uint32(16).int32(message.successCount); } - if (message.pagination !== undefined) { - PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); + if (message.skippedCount !== 0) { + writer.uint32(24).int32(message.skippedCount); + } + if (message.failedCount !== 0) { + writer.uint32(32).int32(message.failedCount); + } + for (const v of message.errors) { + ImportError.encode(v!, writer.uint32(42).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListMBSpinsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ImportMbLustureResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMBSpinsResponse(); + const message = createBaseImportMbLustureResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -15813,19 +25786,35 @@ export const ListMBSpinsResponse: MessageFns = { continue; } case 2: { - if (tag !== 18) { + if (tag !== 16) { break; } - message.data.push(MBSpin.decode(reader, reader.uint32())); + message.successCount = reader.int32(); continue; } case 3: { - if (tag !== 26) { + if (tag !== 24) { break; } - message.pagination = PaginationResponse.decode(reader, reader.uint32()); + message.skippedCount = reader.int32(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.failedCount = reader.int32(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.errors.push(ImportError.decode(reader, reader.uint32())); continue; } } @@ -15837,71 +25826,80 @@ export const ListMBSpinsResponse: MessageFns = { return message; }, - fromJSON(object: any): ListMBSpinsResponse { + fromJSON(object: any): ImportMbLustureResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MBSpin.fromJSON(e)) : [], - pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, + successCount: isSet(object.successCount) + ? globalThis.Number(object.successCount) + : isSet(object.success_count) + ? globalThis.Number(object.success_count) + : 0, + skippedCount: isSet(object.skippedCount) + ? globalThis.Number(object.skippedCount) + : isSet(object.skipped_count) + ? globalThis.Number(object.skipped_count) + : 0, + failedCount: isSet(object.failedCount) + ? globalThis.Number(object.failedCount) + : isSet(object.failed_count) + ? globalThis.Number(object.failed_count) + : 0, + errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => ImportError.fromJSON(e)) : [], }; }, - toJSON(message: ListMBSpinsResponse): unknown { + toJSON(message: ImportMbLustureResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data?.length) { - obj.data = message.data.map((e) => MBSpin.toJSON(e)); + if (message.successCount !== 0) { + obj.successCount = Math.round(message.successCount); } - if (message.pagination !== undefined) { - obj.pagination = PaginationResponse.toJSON(message.pagination); + if (message.skippedCount !== 0) { + obj.skippedCount = Math.round(message.skippedCount); + } + if (message.failedCount !== 0) { + obj.failedCount = Math.round(message.failedCount); + } + if (message.errors?.length) { + obj.errors = message.errors.map((e) => ImportError.toJSON(e)); } return obj; }, - create(base?: DeepPartial): ListMBSpinsResponse { - return ListMBSpinsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ImportMbLustureResponse { + return ImportMbLustureResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListMBSpinsResponse { - const message = createBaseListMBSpinsResponse(); + fromPartial(object: DeepPartial): ImportMbLustureResponse { + const message = createBaseImportMbLustureResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = object.data?.map((e) => MBSpin.fromPartial(e)) || []; - message.pagination = (object.pagination !== undefined && object.pagination !== null) - ? PaginationResponse.fromPartial(object.pagination) - : undefined; + message.successCount = object.successCount ?? 0; + message.skippedCount = object.skippedCount ?? 0; + message.failedCount = object.failedCount ?? 0; + message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; return message; }, }; -function createBaseExportMBSpinsRequest(): ExportMBSpinsRequest { - return { mbhId: "" }; +function createBaseDownloadMbLustureTemplateRequest(): DownloadMbLustureTemplateRequest { + return {}; } -export const ExportMBSpinsRequest: MessageFns = { - encode(message: ExportMBSpinsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); - } +export const DownloadMbLustureTemplateRequest: MessageFns = { + encode(_: DownloadMbLustureTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportMBSpinsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): DownloadMbLustureTemplateRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportMBSpinsRequest(); + const message = createBaseDownloadMbLustureTemplateRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.mbhId = reader.string(); - continue; - } } if ((tag & 7) === 4 || tag === 0) { break; @@ -15911,40 +25909,30 @@ export const ExportMBSpinsRequest: MessageFns = { return message; }, - fromJSON(object: any): ExportMBSpinsRequest { - return { - mbhId: isSet(object.mbhId) - ? globalThis.String(object.mbhId) - : isSet(object.mbh_id) - ? globalThis.String(object.mbh_id) - : "", - }; + fromJSON(_: any): DownloadMbLustureTemplateRequest { + return {}; }, - toJSON(message: ExportMBSpinsRequest): unknown { + toJSON(_: DownloadMbLustureTemplateRequest): unknown { const obj: any = {}; - if (message.mbhId !== "") { - obj.mbhId = message.mbhId; - } return obj; }, - create(base?: DeepPartial): ExportMBSpinsRequest { - return ExportMBSpinsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): DownloadMbLustureTemplateRequest { + return DownloadMbLustureTemplateRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportMBSpinsRequest { - const message = createBaseExportMBSpinsRequest(); - message.mbhId = object.mbhId ?? ""; + fromPartial(_: DeepPartial): DownloadMbLustureTemplateRequest { + const message = createBaseDownloadMbLustureTemplateRequest(); return message; }, }; -function createBaseExportMBSpinsResponse(): ExportMBSpinsResponse { +function createBaseDownloadMbLustureTemplateResponse(): DownloadMbLustureTemplateResponse { return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; } -export const ExportMBSpinsResponse: MessageFns = { - encode(message: ExportMBSpinsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DownloadMbLustureTemplateResponse: MessageFns = { + encode(message: DownloadMbLustureTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } @@ -15957,10 +25945,10 @@ export const ExportMBSpinsResponse: MessageFns = { return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportMBSpinsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): DownloadMbLustureTemplateResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportMBSpinsResponse(); + const message = createBaseDownloadMbLustureTemplateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -15997,7 +25985,7 @@ export const ExportMBSpinsResponse: MessageFns = { return message; }, - fromJSON(object: any): ExportMBSpinsResponse { + fromJSON(object: any): DownloadMbLustureTemplateResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, fileContent: isSet(object.fileContent) @@ -16013,7 +26001,7 @@ export const ExportMBSpinsResponse: MessageFns = { }; }, - toJSON(message: ExportMBSpinsResponse): unknown { + toJSON(message: DownloadMbLustureTemplateResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); @@ -16027,11 +26015,11 @@ export const ExportMBSpinsResponse: MessageFns = { return obj; }, - create(base?: DeepPartial): ExportMBSpinsResponse { - return ExportMBSpinsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): DownloadMbLustureTemplateResponse { + return DownloadMbLustureTemplateResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportMBSpinsResponse { - const message = createBaseExportMBSpinsResponse(); + fromPartial(object: DeepPartial): DownloadMbLustureTemplateResponse { + const message = createBaseDownloadMbLustureTemplateResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; @@ -16041,158 +26029,56 @@ export const ExportMBSpinsResponse: MessageFns = { }, }; -function createBaseImportMBSpinsRequest(): ImportMBSpinsRequest { - return { mbhId: "", fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; +function createBaseCreateMbParamRequest(): CreateMbParamRequest { + return { + code: "", + name: "", + description: "", + type: "", + defaultValue: "", + defaultOption: "", + unit: "", + displayOrder: 0, + isActive: false, + }; } -export const ImportMBSpinsRequest: MessageFns = { - encode(message: ImportMBSpinsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); - } - if (message.fileContent.length !== 0) { - writer.uint32(18).bytes(message.fileContent); - } - if (message.fileName !== "") { - writer.uint32(26).string(message.fileName); - } - if (message.duplicateAction !== "") { - writer.uint32(34).string(message.duplicateAction); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ImportMBSpinsRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportMBSpinsRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.mbhId = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.fileContent = reader.bytes(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.fileName = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.duplicateAction = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ImportMBSpinsRequest { - return { - mbhId: isSet(object.mbhId) - ? globalThis.String(object.mbhId) - : isSet(object.mbh_id) - ? globalThis.String(object.mbh_id) - : "", - fileContent: isSet(object.fileContent) - ? bytesFromBase64(object.fileContent) - : isSet(object.file_content) - ? bytesFromBase64(object.file_content) - : new Uint8Array(0), - fileName: isSet(object.fileName) - ? globalThis.String(object.fileName) - : isSet(object.file_name) - ? globalThis.String(object.file_name) - : "", - duplicateAction: isSet(object.duplicateAction) - ? globalThis.String(object.duplicateAction) - : isSet(object.duplicate_action) - ? globalThis.String(object.duplicate_action) - : "", - }; - }, - - toJSON(message: ImportMBSpinsRequest): unknown { - const obj: any = {}; - if (message.mbhId !== "") { - obj.mbhId = message.mbhId; +export const CreateMbParamRequest: MessageFns = { + encode(message: CreateMbParamRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.code !== "") { + writer.uint32(10).string(message.code); } - if (message.fileContent.length !== 0) { - obj.fileContent = base64FromBytes(message.fileContent); + if (message.name !== "") { + writer.uint32(18).string(message.name); } - if (message.fileName !== "") { - obj.fileName = message.fileName; + if (message.description !== "") { + writer.uint32(26).string(message.description); } - if (message.duplicateAction !== "") { - obj.duplicateAction = message.duplicateAction; + if (message.type !== "") { + writer.uint32(34).string(message.type); } - return obj; - }, - - create(base?: DeepPartial): ImportMBSpinsRequest { - return ImportMBSpinsRequest.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): ImportMBSpinsRequest { - const message = createBaseImportMBSpinsRequest(); - message.mbhId = object.mbhId ?? ""; - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; - message.duplicateAction = object.duplicateAction ?? ""; - return message; - }, -}; - -function createBaseImportMBSpinsResponse(): ImportMBSpinsResponse { - return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; -} - -export const ImportMBSpinsResponse: MessageFns = { - encode(message: ImportMBSpinsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + if (message.defaultValue !== "") { + writer.uint32(42).string(message.defaultValue); } - if (message.successCount !== 0) { - writer.uint32(16).int32(message.successCount); + if (message.defaultOption !== "") { + writer.uint32(50).string(message.defaultOption); } - if (message.skippedCount !== 0) { - writer.uint32(24).int32(message.skippedCount); + if (message.unit !== "") { + writer.uint32(58).string(message.unit); } - if (message.failedCount !== 0) { - writer.uint32(32).int32(message.failedCount); + if (message.displayOrder !== 0) { + writer.uint32(64).int32(message.displayOrder); } - for (const v of message.errors) { - ImportError.encode(v!, writer.uint32(42).fork()).join(); + if (message.isActive !== false) { + writer.uint32(72).bool(message.isActive); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportMBSpinsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMbParamRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportMBSpinsResponse(); + const message = createBaseCreateMbParamRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -16201,31 +26087,31 @@ export const ImportMBSpinsResponse: MessageFns = { break; } - message.base = BaseResponse.decode(reader, reader.uint32()); + message.code = reader.string(); continue; } case 2: { - if (tag !== 16) { + if (tag !== 18) { break; } - message.successCount = reader.int32(); + message.name = reader.string(); continue; } case 3: { - if (tag !== 24) { + if (tag !== 26) { break; } - message.skippedCount = reader.int32(); + message.description = reader.string(); continue; } case 4: { - if (tag !== 32) { + if (tag !== 34) { break; } - message.failedCount = reader.int32(); + message.type = reader.string(); continue; } case 5: { @@ -16233,101 +26119,39 @@ export const ImportMBSpinsResponse: MessageFns = { break; } - message.errors.push(ImportError.decode(reader, reader.uint32())); + message.defaultValue = reader.string(); continue; } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): ImportMBSpinsResponse { - return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - successCount: isSet(object.successCount) - ? globalThis.Number(object.successCount) - : isSet(object.success_count) - ? globalThis.Number(object.success_count) - : 0, - skippedCount: isSet(object.skippedCount) - ? globalThis.Number(object.skippedCount) - : isSet(object.skipped_count) - ? globalThis.Number(object.skipped_count) - : 0, - failedCount: isSet(object.failedCount) - ? globalThis.Number(object.failedCount) - : isSet(object.failed_count) - ? globalThis.Number(object.failed_count) - : 0, - errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => ImportError.fromJSON(e)) : [], - }; - }, - - toJSON(message: ImportMBSpinsResponse): unknown { - const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); - } - if (message.successCount !== 0) { - obj.successCount = Math.round(message.successCount); - } - if (message.skippedCount !== 0) { - obj.skippedCount = Math.round(message.skippedCount); - } - if (message.failedCount !== 0) { - obj.failedCount = Math.round(message.failedCount); - } - if (message.errors?.length) { - obj.errors = message.errors.map((e) => ImportError.toJSON(e)); - } - return obj; - }, - - create(base?: DeepPartial): ImportMBSpinsResponse { - return ImportMBSpinsResponse.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): ImportMBSpinsResponse { - const message = createBaseImportMBSpinsResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.successCount = object.successCount ?? 0; - message.skippedCount = object.skippedCount ?? 0; - message.failedCount = object.failedCount ?? 0; - message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; - return message; - }, -}; + case 6: { + if (tag !== 50) { + break; + } -function createBaseDownloadMBSpinTemplateRequest(): DownloadMBSpinTemplateRequest { - return { mbhId: "" }; -} + message.defaultOption = reader.string(); + continue; + } + case 7: { + if (tag !== 58) { + break; + } -export const DownloadMBSpinTemplateRequest: MessageFns = { - encode(message: DownloadMBSpinTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.mbhId !== "") { - writer.uint32(10).string(message.mbhId); - } - return writer; - }, + message.unit = reader.string(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } - decode(input: BinaryReader | Uint8Array, length?: number): DownloadMBSpinTemplateRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDownloadMBSpinTemplateRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { + message.displayOrder = reader.int32(); + continue; + } + case 9: { + if (tag !== 72) { break; } - message.mbhId = reader.string(); + message.isActive = reader.bool(); continue; } } @@ -16339,56 +26163,105 @@ export const DownloadMBSpinTemplateRequest: MessageFns): DownloadMBSpinTemplateRequest { - return DownloadMBSpinTemplateRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMbParamRequest { + return CreateMbParamRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DownloadMBSpinTemplateRequest { - const message = createBaseDownloadMBSpinTemplateRequest(); - message.mbhId = object.mbhId ?? ""; + fromPartial(object: DeepPartial): CreateMbParamRequest { + const message = createBaseCreateMbParamRequest(); + message.code = object.code ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.type = object.type ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.defaultOption = object.defaultOption ?? ""; + message.unit = object.unit ?? ""; + message.displayOrder = object.displayOrder ?? 0; + message.isActive = object.isActive ?? false; return message; }, }; -function createBaseDownloadMBSpinTemplateResponse(): DownloadMBSpinTemplateResponse { - return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +function createBaseCreateMbParamResponse(): CreateMbParamResponse { + return { base: undefined, data: undefined }; } -export const DownloadMBSpinTemplateResponse: MessageFns = { - encode(message: DownloadMBSpinTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const CreateMbParamResponse: MessageFns = { + encode(message: CreateMbParamResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.fileContent.length !== 0) { - writer.uint32(18).bytes(message.fileContent); - } - if (message.fileName !== "") { - writer.uint32(26).string(message.fileName); + if (message.data !== undefined) { + MbParam.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DownloadMBSpinTemplateResponse { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMbParamResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDownloadMBSpinTemplateResponse(); + const message = createBaseCreateMbParamResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -16405,15 +26278,7 @@ export const DownloadMBSpinTemplateResponse: MessageFns): DownloadMBSpinTemplateResponse { - return DownloadMBSpinTemplateResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMbParamResponse { + return CreateMbParamResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DownloadMBSpinTemplateResponse { - const message = createBaseDownloadMBSpinTemplateResponse(); + fromPartial(object: DeepPartial): CreateMbParamResponse { + const message = createBaseCreateMbParamResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; + message.data = (object.data !== undefined && object.data !== null) ? MbParam.fromPartial(object.data) : undefined; return message; }, }; -function createBaseGetLookupFillValuesRequest(): GetLookupFillValuesRequest { - return { lookupMasterCode: "", selectedKey: "", sourceParamCode: "" }; +function createBaseUpdateMbParamRequest(): UpdateMbParamRequest { + return { + mbpId: "", + name: "", + description: "", + defaultValue: "", + defaultOption: "", + unit: "", + displayOrder: 0, + isActive: false, + }; } -export const GetLookupFillValuesRequest: MessageFns = { - encode(message: GetLookupFillValuesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.lookupMasterCode !== "") { - writer.uint32(10).string(message.lookupMasterCode); +export const UpdateMbParamRequest: MessageFns = { + encode(message: UpdateMbParamRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbpId !== "") { + writer.uint32(10).string(message.mbpId); } - if (message.selectedKey !== "") { - writer.uint32(18).string(message.selectedKey); + if (message.name !== "") { + writer.uint32(18).string(message.name); } - if (message.sourceParamCode !== "") { - writer.uint32(26).string(message.sourceParamCode); + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.defaultValue !== "") { + writer.uint32(34).string(message.defaultValue); + } + if (message.defaultOption !== "") { + writer.uint32(42).string(message.defaultOption); + } + if (message.unit !== "") { + writer.uint32(50).string(message.unit); + } + if (message.displayOrder !== 0) { + writer.uint32(56).int32(message.displayOrder); + } + if (message.isActive !== false) { + writer.uint32(64).bool(message.isActive); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetLookupFillValuesRequest { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMbParamRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetLookupFillValuesRequest(); + const message = createBaseUpdateMbParamRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -16499,7 +26375,7 @@ export const GetLookupFillValuesRequest: MessageFns break; } - message.lookupMasterCode = reader.string(); + message.mbpId = reader.string(); continue; } case 2: { @@ -16507,7 +26383,7 @@ export const GetLookupFillValuesRequest: MessageFns break; } - message.selectedKey = reader.string(); + message.name = reader.string(); continue; } case 3: { @@ -16515,7 +26391,47 @@ export const GetLookupFillValuesRequest: MessageFns break; } - message.sourceParamCode = reader.string(); + message.description = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.defaultValue = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } + + message.defaultOption = reader.string(); + continue; + } + case 6: { + if (tag !== 50) { + break; + } + + message.unit = reader.string(); + continue; + } + case 7: { + if (tag !== 56) { + break; + } + + message.displayOrder = reader.int32(); + continue; + } + case 8: { + if (tag !== 64) { + break; + } + + message.isActive = reader.bool(); continue; } } @@ -16527,77 +26443,104 @@ export const GetLookupFillValuesRequest: MessageFns return message; }, - fromJSON(object: any): GetLookupFillValuesRequest { + fromJSON(object: any): UpdateMbParamRequest { return { - lookupMasterCode: isSet(object.lookupMasterCode) - ? globalThis.String(object.lookupMasterCode) - : isSet(object.lookup_master_code) - ? globalThis.String(object.lookup_master_code) + mbpId: isSet(object.mbpId) + ? globalThis.String(object.mbpId) + : isSet(object.mbp_id) + ? globalThis.String(object.mbp_id) : "", - selectedKey: isSet(object.selectedKey) - ? globalThis.String(object.selectedKey) - : isSet(object.selected_key) - ? globalThis.String(object.selected_key) + name: isSet(object.name) ? globalThis.String(object.name) : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + defaultValue: isSet(object.defaultValue) + ? globalThis.String(object.defaultValue) + : isSet(object.default_value) + ? globalThis.String(object.default_value) : "", - sourceParamCode: isSet(object.sourceParamCode) - ? globalThis.String(object.sourceParamCode) - : isSet(object.source_param_code) - ? globalThis.String(object.source_param_code) + defaultOption: isSet(object.defaultOption) + ? globalThis.String(object.defaultOption) + : isSet(object.default_option) + ? globalThis.String(object.default_option) : "", + unit: isSet(object.unit) ? globalThis.String(object.unit) : "", + displayOrder: isSet(object.displayOrder) + ? globalThis.Number(object.displayOrder) + : isSet(object.display_order) + ? globalThis.Number(object.display_order) + : 0, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, }; }, - toJSON(message: GetLookupFillValuesRequest): unknown { + toJSON(message: UpdateMbParamRequest): unknown { const obj: any = {}; - if (message.lookupMasterCode !== "") { - obj.lookupMasterCode = message.lookupMasterCode; + if (message.mbpId !== "") { + obj.mbpId = message.mbpId; } - if (message.selectedKey !== "") { - obj.selectedKey = message.selectedKey; + if (message.name !== "") { + obj.name = message.name; } - if (message.sourceParamCode !== "") { - obj.sourceParamCode = message.sourceParamCode; + if (message.description !== "") { + obj.description = message.description; + } + if (message.defaultValue !== "") { + obj.defaultValue = message.defaultValue; + } + if (message.defaultOption !== "") { + obj.defaultOption = message.defaultOption; + } + if (message.unit !== "") { + obj.unit = message.unit; + } + if (message.displayOrder !== 0) { + obj.displayOrder = Math.round(message.displayOrder); + } + if (message.isActive !== false) { + obj.isActive = message.isActive; } return obj; }, - create(base?: DeepPartial): GetLookupFillValuesRequest { - return GetLookupFillValuesRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateMbParamRequest { + return UpdateMbParamRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetLookupFillValuesRequest { - const message = createBaseGetLookupFillValuesRequest(); - message.lookupMasterCode = object.lookupMasterCode ?? ""; - message.selectedKey = object.selectedKey ?? ""; - message.sourceParamCode = object.sourceParamCode ?? ""; + fromPartial(object: DeepPartial): UpdateMbParamRequest { + const message = createBaseUpdateMbParamRequest(); + message.mbpId = object.mbpId ?? ""; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.defaultOption = object.defaultOption ?? ""; + message.unit = object.unit ?? ""; + message.displayOrder = object.displayOrder ?? 0; + message.isActive = object.isActive ?? false; return message; }, }; -function createBaseGetLookupFillValuesResponse(): GetLookupFillValuesResponse { - return { base: undefined, numericFills: {}, textFills: {}, displayLabel: "" }; +function createBaseUpdateMbParamResponse(): UpdateMbParamResponse { + return { base: undefined, data: undefined }; } -export const GetLookupFillValuesResponse: MessageFns = { - encode(message: GetLookupFillValuesResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const UpdateMbParamResponse: MessageFns = { + encode(message: UpdateMbParamResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - globalThis.Object.entries(message.numericFills).forEach(([key, value]: [string, number]) => { - GetLookupFillValuesResponse_NumericFillsEntry.encode({ key: key as any, value }, writer.uint32(18).fork()).join(); - }); - globalThis.Object.entries(message.textFills).forEach(([key, value]: [string, string]) => { - GetLookupFillValuesResponse_TextFillsEntry.encode({ key: key as any, value }, writer.uint32(26).fork()).join(); - }); - if (message.displayLabel !== "") { - writer.uint32(34).string(message.displayLabel); + if (message.data !== undefined) { + MbParam.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetLookupFillValuesResponse { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMbParamResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetLookupFillValuesResponse(); + const message = createBaseUpdateMbParamResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -16614,29 +26557,7 @@ export const GetLookupFillValuesResponse: MessageFns { - acc[key] = globalThis.Number(value); - return acc; - }, - {}, - ) - : isObject(object.numeric_fills) - ? (globalThis.Object.entries(object.numeric_fills) as [string, any][]).reduce( - (acc: { [key: string]: number }, [key, value]: [string, any]) => { - acc[key] = globalThis.Number(value); - return acc; - }, - {}, - ) - : {}, - textFills: isObject(object.textFills) - ? (globalThis.Object.entries(object.textFills) as [string, any][]).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => { - acc[key] = globalThis.String(value); - return acc; - }, - {}, - ) - : isObject(object.text_fills) - ? (globalThis.Object.entries(object.text_fills) as [string, any][]).reduce( - (acc: { [key: string]: string }, [key, value]: [string, any]) => { - acc[key] = globalThis.String(value); - return acc; - }, - {}, - ) - : {}, - displayLabel: isSet(object.displayLabel) - ? globalThis.String(object.displayLabel) - : isSet(object.display_label) - ? globalThis.String(object.display_label) - : "", + data: isSet(object.data) ? MbParam.fromJSON(object.data) : undefined, }; }, - toJSON(message: GetLookupFillValuesResponse): unknown { + toJSON(message: UpdateMbParamResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.numericFills) { - const entries = globalThis.Object.entries(message.numericFills) as [string, number][]; - if (entries.length > 0) { - obj.numericFills = {}; - entries.forEach(([k, v]) => { - obj.numericFills[k] = v; - }); - } - } - if (message.textFills) { - const entries = globalThis.Object.entries(message.textFills) as [string, string][]; - if (entries.length > 0) { - obj.textFills = {}; - entries.forEach(([k, v]) => { - obj.textFills[k] = v; - }); - } - } - if (message.displayLabel !== "") { - obj.displayLabel = message.displayLabel; + if (message.data !== undefined) { + obj.data = MbParam.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): GetLookupFillValuesResponse { - return GetLookupFillValuesResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateMbParamResponse { + return UpdateMbParamResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): GetLookupFillValuesResponse { - const message = createBaseGetLookupFillValuesResponse(); + fromPartial(object: DeepPartial): UpdateMbParamResponse { + const message = createBaseUpdateMbParamResponse(); message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.numericFills = (globalThis.Object.entries(object.numericFills ?? {}) as [string, number][]).reduce( - (acc: { [key: string]: number }, [key, value]: [string, number]) => { - if (value !== undefined) { - acc[key] = globalThis.Number(value); - } - return acc; - }, - {}, - ); - message.textFills = (globalThis.Object.entries(object.textFills ?? {}) as [string, string][]).reduce( - (acc: { [key: string]: string }, [key, value]: [string, string]) => { - if (value !== undefined) { - acc[key] = globalThis.String(value); - } - return acc; - }, - {}, - ); - message.displayLabel = object.displayLabel ?? ""; - return message; - }, -}; - -function createBaseGetLookupFillValuesResponse_NumericFillsEntry(): GetLookupFillValuesResponse_NumericFillsEntry { - return { key: "", value: 0 }; -} - -export const GetLookupFillValuesResponse_NumericFillsEntry: MessageFns = - { - encode( - message: GetLookupFillValuesResponse_NumericFillsEntry, - writer: BinaryWriter = new BinaryWriter(), - ): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== 0) { - writer.uint32(17).double(message.value); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): GetLookupFillValuesResponse_NumericFillsEntry { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetLookupFillValuesResponse_NumericFillsEntry(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 10) { - break; - } - - message.key = reader.string(); - continue; - } - case 2: { - if (tag !== 17) { - break; - } - - message.value = reader.double(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): GetLookupFillValuesResponse_NumericFillsEntry { - return { - key: isSet(object.key) ? globalThis.String(object.key) : "", - value: isSet(object.value) ? globalThis.Number(object.value) : 0, - }; - }, - - toJSON(message: GetLookupFillValuesResponse_NumericFillsEntry): unknown { - const obj: any = {}; - if (message.key !== "") { - obj.key = message.key; - } - if (message.value !== 0) { - obj.value = message.value; - } - return obj; - }, - - create( - base?: DeepPartial, - ): GetLookupFillValuesResponse_NumericFillsEntry { - return GetLookupFillValuesResponse_NumericFillsEntry.fromPartial(base ?? {}); - }, - fromPartial( - object: DeepPartial, - ): GetLookupFillValuesResponse_NumericFillsEntry { - const message = createBaseGetLookupFillValuesResponse_NumericFillsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? 0; - return message; - }, - }; + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MbParam.fromPartial(object.data) : undefined; + return message; + }, +}; -function createBaseGetLookupFillValuesResponse_TextFillsEntry(): GetLookupFillValuesResponse_TextFillsEntry { - return { key: "", value: "" }; +function createBaseDeleteMbParamRequest(): DeleteMbParamRequest { + return { mbpId: "" }; } -export const GetLookupFillValuesResponse_TextFillsEntry: MessageFns = { - encode(message: GetLookupFillValuesResponse_TextFillsEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.key !== "") { - writer.uint32(10).string(message.key); - } - if (message.value !== "") { - writer.uint32(18).string(message.value); +export const DeleteMbParamRequest: MessageFns = { + encode(message: DeleteMbParamRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbpId !== "") { + writer.uint32(10).string(message.mbpId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): GetLookupFillValuesResponse_TextFillsEntry { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMbParamRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetLookupFillValuesResponse_TextFillsEntry(); + const message = createBaseDeleteMbParamRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -16864,15 +26624,71 @@ export const GetLookupFillValuesResponse_TextFillsEntry: MessageFns): DeleteMbParamRequest { + return DeleteMbParamRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): DeleteMbParamRequest { + const message = createBaseDeleteMbParamRequest(); + message.mbpId = object.mbpId ?? ""; + return message; + }, +}; + +function createBaseDeleteMbParamResponse(): DeleteMbParamResponse { + return { base: undefined }; +} + +export const DeleteMbParamResponse: MessageFns = { + encode(message: DeleteMbParamResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMbParamResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteMbParamResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { break; } - message.value = reader.string(); + message.base = BaseResponse.decode(reader, reader.uint32()); continue; } } @@ -16884,96 +26700,78 @@ export const GetLookupFillValuesResponse_TextFillsEntry: MessageFns): GetLookupFillValuesResponse_TextFillsEntry { - return GetLookupFillValuesResponse_TextFillsEntry.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMbParamResponse { + return DeleteMbParamResponse.fromPartial(base ?? {}); }, - fromPartial( - object: DeepPartial, - ): GetLookupFillValuesResponse_TextFillsEntry { - const message = createBaseGetLookupFillValuesResponse_TextFillsEntry(); - message.key = object.key ?? ""; - message.value = object.value ?? ""; + fromPartial(object: DeepPartial): DeleteMbParamResponse { + const message = createBaseDeleteMbParamResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; return message; }, }; -function createBaseLookupMaster(): LookupMaster { - return { - lmCode: "", - lmDisplayName: "", - lmApiPath: "", - lmCodeField: "", - lmLabelField: "", - lmIsActive: false, - lmTableName: "", - }; +function createBaseListMbParamsRequest(): ListMbParamsRequest { + return { page: 0, pageSize: 0, search: "", sortBy: "", sortDir: "", activeFilter: 0 }; } -export const LookupMaster: MessageFns = { - encode(message: LookupMaster, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.lmCode !== "") { - writer.uint32(10).string(message.lmCode); - } - if (message.lmDisplayName !== "") { - writer.uint32(18).string(message.lmDisplayName); +export const ListMbParamsRequest: MessageFns = { + encode(message: ListMbParamsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.page !== 0) { + writer.uint32(8).int32(message.page); } - if (message.lmApiPath !== "") { - writer.uint32(26).string(message.lmApiPath); + if (message.pageSize !== 0) { + writer.uint32(16).int32(message.pageSize); } - if (message.lmCodeField !== "") { - writer.uint32(34).string(message.lmCodeField); + if (message.search !== "") { + writer.uint32(26).string(message.search); } - if (message.lmLabelField !== "") { - writer.uint32(42).string(message.lmLabelField); + if (message.sortBy !== "") { + writer.uint32(34).string(message.sortBy); } - if (message.lmIsActive !== false) { - writer.uint32(48).bool(message.lmIsActive); + if (message.sortDir !== "") { + writer.uint32(42).string(message.sortDir); } - if (message.lmTableName !== "") { - writer.uint32(58).string(message.lmTableName); + if (message.activeFilter !== 0) { + writer.uint32(48).int32(message.activeFilter); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): LookupMaster { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbParamsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLookupMaster(); + const message = createBaseListMbParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 10) { + if (tag !== 8) { break; } - message.lmCode = reader.string(); + message.page = reader.int32(); continue; } case 2: { - if (tag !== 18) { + if (tag !== 16) { break; } - message.lmDisplayName = reader.string(); + message.pageSize = reader.int32(); continue; } case 3: { @@ -16981,157 +26779,31 @@ export const LookupMaster: MessageFns = { break; } - message.lmApiPath = reader.string(); + message.search = reader.string(); continue; } case 4: { if (tag !== 34) { break; - } - - message.lmCodeField = reader.string(); - continue; - } - case 5: { - if (tag !== 42) { - break; - } - - message.lmLabelField = reader.string(); - continue; - } - case 6: { - if (tag !== 48) { - break; - } - - message.lmIsActive = reader.bool(); - continue; - } - case 7: { - if (tag !== 58) { - break; - } - - message.lmTableName = reader.string(); - continue; - } - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): LookupMaster { - return { - lmCode: isSet(object.lmCode) - ? globalThis.String(object.lmCode) - : isSet(object.lm_code) - ? globalThis.String(object.lm_code) - : "", - lmDisplayName: isSet(object.lmDisplayName) - ? globalThis.String(object.lmDisplayName) - : isSet(object.lm_display_name) - ? globalThis.String(object.lm_display_name) - : "", - lmApiPath: isSet(object.lmApiPath) - ? globalThis.String(object.lmApiPath) - : isSet(object.lm_api_path) - ? globalThis.String(object.lm_api_path) - : "", - lmCodeField: isSet(object.lmCodeField) - ? globalThis.String(object.lmCodeField) - : isSet(object.lm_code_field) - ? globalThis.String(object.lm_code_field) - : "", - lmLabelField: isSet(object.lmLabelField) - ? globalThis.String(object.lmLabelField) - : isSet(object.lm_label_field) - ? globalThis.String(object.lm_label_field) - : "", - lmIsActive: isSet(object.lmIsActive) - ? globalThis.Boolean(object.lmIsActive) - : isSet(object.lm_is_active) - ? globalThis.Boolean(object.lm_is_active) - : false, - lmTableName: isSet(object.lmTableName) - ? globalThis.String(object.lmTableName) - : isSet(object.lm_table_name) - ? globalThis.String(object.lm_table_name) - : "", - }; - }, - - toJSON(message: LookupMaster): unknown { - const obj: any = {}; - if (message.lmCode !== "") { - obj.lmCode = message.lmCode; - } - if (message.lmDisplayName !== "") { - obj.lmDisplayName = message.lmDisplayName; - } - if (message.lmApiPath !== "") { - obj.lmApiPath = message.lmApiPath; - } - if (message.lmCodeField !== "") { - obj.lmCodeField = message.lmCodeField; - } - if (message.lmLabelField !== "") { - obj.lmLabelField = message.lmLabelField; - } - if (message.lmIsActive !== false) { - obj.lmIsActive = message.lmIsActive; - } - if (message.lmTableName !== "") { - obj.lmTableName = message.lmTableName; - } - return obj; - }, - - create(base?: DeepPartial): LookupMaster { - return LookupMaster.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): LookupMaster { - const message = createBaseLookupMaster(); - message.lmCode = object.lmCode ?? ""; - message.lmDisplayName = object.lmDisplayName ?? ""; - message.lmApiPath = object.lmApiPath ?? ""; - message.lmCodeField = object.lmCodeField ?? ""; - message.lmLabelField = object.lmLabelField ?? ""; - message.lmIsActive = object.lmIsActive ?? false; - message.lmTableName = object.lmTableName ?? ""; - return message; - }, -}; - -function createBaseListLookupMastersRequest(): ListLookupMastersRequest { - return { activeOnly: false }; -} + } -export const ListLookupMastersRequest: MessageFns = { - encode(message: ListLookupMastersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.activeOnly !== false) { - writer.uint32(8).bool(message.activeOnly); - } - return writer; - }, + message.sortBy = reader.string(); + continue; + } + case 5: { + if (tag !== 42) { + break; + } - decode(input: BinaryReader | Uint8Array, length?: number): ListLookupMastersRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListLookupMastersRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: { - if (tag !== 8) { + message.sortDir = reader.string(); + continue; + } + case 6: { + if (tag !== 48) { break; } - message.activeOnly = reader.bool(); + message.activeFilter = reader.int32() as any; continue; } } @@ -17143,53 +26815,93 @@ export const ListLookupMastersRequest: MessageFns = { return message; }, - fromJSON(object: any): ListLookupMastersRequest { + fromJSON(object: any): ListMbParamsRequest { return { - activeOnly: isSet(object.activeOnly) - ? globalThis.Boolean(object.activeOnly) - : isSet(object.active_only) - ? globalThis.Boolean(object.active_only) - : false, + page: isSet(object.page) ? globalThis.Number(object.page) : 0, + pageSize: isSet(object.pageSize) + ? globalThis.Number(object.pageSize) + : isSet(object.page_size) + ? globalThis.Number(object.page_size) + : 0, + search: isSet(object.search) ? globalThis.String(object.search) : "", + sortBy: isSet(object.sortBy) + ? globalThis.String(object.sortBy) + : isSet(object.sort_by) + ? globalThis.String(object.sort_by) + : "", + sortDir: isSet(object.sortDir) + ? globalThis.String(object.sortDir) + : isSet(object.sort_dir) + ? globalThis.String(object.sort_dir) + : "", + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) + : 0, }; }, - toJSON(message: ListLookupMastersRequest): unknown { + toJSON(message: ListMbParamsRequest): unknown { const obj: any = {}; - if (message.activeOnly !== false) { - obj.activeOnly = message.activeOnly; + if (message.page !== 0) { + obj.page = Math.round(message.page); + } + if (message.pageSize !== 0) { + obj.pageSize = Math.round(message.pageSize); + } + if (message.search !== "") { + obj.search = message.search; + } + if (message.sortBy !== "") { + obj.sortBy = message.sortBy; + } + if (message.sortDir !== "") { + obj.sortDir = message.sortDir; + } + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); } return obj; }, - create(base?: DeepPartial): ListLookupMastersRequest { - return ListLookupMastersRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMbParamsRequest { + return ListMbParamsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListLookupMastersRequest { - const message = createBaseListLookupMastersRequest(); - message.activeOnly = object.activeOnly ?? false; + fromPartial(object: DeepPartial): ListMbParamsRequest { + const message = createBaseListMbParamsRequest(); + message.page = object.page ?? 0; + message.pageSize = object.pageSize ?? 0; + message.search = object.search ?? ""; + message.sortBy = object.sortBy ?? ""; + message.sortDir = object.sortDir ?? ""; + message.activeFilter = object.activeFilter ?? 0; return message; }, }; -function createBaseListLookupMastersResponse(): ListLookupMastersResponse { - return { base: undefined, data: [] }; +function createBaseListMbParamsResponse(): ListMbParamsResponse { + return { base: undefined, data: [], pagination: undefined }; } -export const ListLookupMastersResponse: MessageFns = { - encode(message: ListLookupMastersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListMbParamsResponse: MessageFns = { + encode(message: ListMbParamsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } for (const v of message.data) { - LookupMaster.encode(v!, writer.uint32(18).fork()).join(); + MbParam.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.pagination !== undefined) { + PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListLookupMastersResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbParamsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListLookupMastersResponse(); + const message = createBaseListMbParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -17206,7 +26918,15 @@ export const ListLookupMastersResponse: MessageFns = break; } - message.data.push(LookupMaster.decode(reader, reader.uint32())); + message.data.push(MbParam.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pagination = PaginationResponse.decode(reader, reader.uint32()); continue; } } @@ -17218,117 +26938,69 @@ export const ListLookupMastersResponse: MessageFns = return message; }, - fromJSON(object: any): ListLookupMastersResponse { + fromJSON(object: any): ListMbParamsResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => LookupMaster.fromJSON(e)) : [], + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MbParam.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: ListLookupMastersResponse): unknown { + toJSON(message: ListMbParamsResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data?.length) { - obj.data = message.data.map((e) => LookupMaster.toJSON(e)); + obj.data = message.data.map((e) => MbParam.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PaginationResponse.toJSON(message.pagination); } return obj; }, - create(base?: DeepPartial): ListLookupMastersResponse { - return ListLookupMastersResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMbParamsResponse { + return ListMbParamsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListLookupMastersResponse { - const message = createBaseListLookupMastersResponse(); + fromPartial(object: DeepPartial): ListMbParamsResponse { + const message = createBaseListMbParamsResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = object.data?.map((e) => LookupMaster.fromPartial(e)) || []; + message.data = object.data?.map((e) => MbParam.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PaginationResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseLookupMasterColumn(): LookupMasterColumn { - return { lmcMasterCode: "", lmcColumnName: "", lmcDisplayName: "", lmcDataType: "", lmcSortOrder: 0, lmcId: "" }; +function createBaseExportMbParamsRequest(): ExportMbParamsRequest { + return { activeFilter: 0 }; } -export const LookupMasterColumn: MessageFns = { - encode(message: LookupMasterColumn, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.lmcMasterCode !== "") { - writer.uint32(10).string(message.lmcMasterCode); - } - if (message.lmcColumnName !== "") { - writer.uint32(18).string(message.lmcColumnName); - } - if (message.lmcDisplayName !== "") { - writer.uint32(26).string(message.lmcDisplayName); - } - if (message.lmcDataType !== "") { - writer.uint32(34).string(message.lmcDataType); - } - if (message.lmcSortOrder !== 0) { - writer.uint32(40).int32(message.lmcSortOrder); - } - if (message.lmcId !== "") { - writer.uint32(50).string(message.lmcId); +export const ExportMbParamsRequest: MessageFns = { + encode(message: ExportMbParamsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.activeFilter !== 0) { + writer.uint32(8).int32(message.activeFilter); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): LookupMasterColumn { + decode(input: BinaryReader | Uint8Array, length?: number): ExportMbParamsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLookupMasterColumn(); + const message = createBaseExportMbParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 10) { - break; - } - - message.lmcMasterCode = reader.string(); - continue; - } - case 2: { - if (tag !== 18) { - break; - } - - message.lmcColumnName = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.lmcDisplayName = reader.string(); - continue; - } - case 4: { - if (tag !== 34) { - break; - } - - message.lmcDataType = reader.string(); - continue; - } - case 5: { - if (tag !== 40) { - break; - } - - message.lmcSortOrder = reader.int32(); - continue; - } - case 6: { - if (tag !== 50) { + if (tag !== 8) { break; } - message.lmcId = reader.string(); + message.activeFilter = reader.int32() as any; continue; } } @@ -17340,95 +27012,56 @@ export const LookupMasterColumn: MessageFns = { return message; }, - fromJSON(object: any): LookupMasterColumn { + fromJSON(object: any): ExportMbParamsRequest { return { - lmcMasterCode: isSet(object.lmcMasterCode) - ? globalThis.String(object.lmcMasterCode) - : isSet(object.lmc_master_code) - ? globalThis.String(object.lmc_master_code) - : "", - lmcColumnName: isSet(object.lmcColumnName) - ? globalThis.String(object.lmcColumnName) - : isSet(object.lmc_column_name) - ? globalThis.String(object.lmc_column_name) - : "", - lmcDisplayName: isSet(object.lmcDisplayName) - ? globalThis.String(object.lmcDisplayName) - : isSet(object.lmc_display_name) - ? globalThis.String(object.lmc_display_name) - : "", - lmcDataType: isSet(object.lmcDataType) - ? globalThis.String(object.lmcDataType) - : isSet(object.lmc_data_type) - ? globalThis.String(object.lmc_data_type) - : "", - lmcSortOrder: isSet(object.lmcSortOrder) - ? globalThis.Number(object.lmcSortOrder) - : isSet(object.lmc_sort_order) - ? globalThis.Number(object.lmc_sort_order) + activeFilter: isSet(object.activeFilter) + ? activeFilterFromJSON(object.activeFilter) + : isSet(object.active_filter) + ? activeFilterFromJSON(object.active_filter) : 0, - lmcId: isSet(object.lmcId) - ? globalThis.String(object.lmcId) - : isSet(object.lmc_id) - ? globalThis.String(object.lmc_id) - : "", }; }, - toJSON(message: LookupMasterColumn): unknown { + toJSON(message: ExportMbParamsRequest): unknown { const obj: any = {}; - if (message.lmcMasterCode !== "") { - obj.lmcMasterCode = message.lmcMasterCode; - } - if (message.lmcColumnName !== "") { - obj.lmcColumnName = message.lmcColumnName; - } - if (message.lmcDisplayName !== "") { - obj.lmcDisplayName = message.lmcDisplayName; - } - if (message.lmcDataType !== "") { - obj.lmcDataType = message.lmcDataType; - } - if (message.lmcSortOrder !== 0) { - obj.lmcSortOrder = Math.round(message.lmcSortOrder); - } - if (message.lmcId !== "") { - obj.lmcId = message.lmcId; + if (message.activeFilter !== 0) { + obj.activeFilter = activeFilterToJSON(message.activeFilter); } - return obj; - }, - - create(base?: DeepPartial): LookupMasterColumn { - return LookupMasterColumn.fromPartial(base ?? {}); - }, - fromPartial(object: DeepPartial): LookupMasterColumn { - const message = createBaseLookupMasterColumn(); - message.lmcMasterCode = object.lmcMasterCode ?? ""; - message.lmcColumnName = object.lmcColumnName ?? ""; - message.lmcDisplayName = object.lmcDisplayName ?? ""; - message.lmcDataType = object.lmcDataType ?? ""; - message.lmcSortOrder = object.lmcSortOrder ?? 0; - message.lmcId = object.lmcId ?? ""; + return obj; + }, + + create(base?: DeepPartial): ExportMbParamsRequest { + return ExportMbParamsRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ExportMbParamsRequest { + const message = createBaseExportMbParamsRequest(); + message.activeFilter = object.activeFilter ?? 0; return message; }, }; -function createBaseListLookupMasterColumnsRequest(): ListLookupMasterColumnsRequest { - return { masterCode: "" }; +function createBaseExportMbParamsResponse(): ExportMbParamsResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; } -export const ListLookupMasterColumnsRequest: MessageFns = { - encode(message: ListLookupMasterColumnsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.masterCode !== "") { - writer.uint32(10).string(message.masterCode); +export const ExportMbParamsResponse: MessageFns = { + encode(message: ExportMbParamsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListLookupMasterColumnsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ExportMbParamsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListLookupMasterColumnsRequest(); + const message = createBaseExportMbParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -17437,7 +27070,23 @@ export const ListLookupMasterColumnsRequest: MessageFns): ListLookupMasterColumnsRequest { - return ListLookupMasterColumnsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ExportMbParamsResponse { + return ExportMbParamsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListLookupMasterColumnsRequest { - const message = createBaseListLookupMasterColumnsRequest(); - message.masterCode = object.masterCode ?? ""; + fromPartial(object: DeepPartial): ExportMbParamsResponse { + const message = createBaseExportMbParamsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; return message; }, }; -function createBaseListLookupMasterColumnsResponse(): ListLookupMasterColumnsResponse { - return { base: undefined, data: [] }; +function createBaseImportMbParamsRequest(): ImportMbParamsRequest { + return { fileContent: new Uint8Array(0), fileName: "", duplicateAction: "" }; } -export const ListLookupMasterColumnsResponse: MessageFns = { - encode(message: ListLookupMasterColumnsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); +export const ImportMbParamsRequest: MessageFns = { + encode(message: ImportMbParamsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.fileContent.length !== 0) { + writer.uint32(10).bytes(message.fileContent); } - for (const v of message.data) { - LookupMasterColumn.encode(v!, writer.uint32(18).fork()).join(); + if (message.fileName !== "") { + writer.uint32(18).string(message.fileName); + } + if (message.duplicateAction !== "") { + writer.uint32(26).string(message.duplicateAction); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListLookupMasterColumnsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ImportMbParamsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListLookupMasterColumnsResponse(); + const message = createBaseImportMbParamsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -17504,7 +27172,7 @@ export const ListLookupMasterColumnsResponse: MessageFns LookupMasterColumn.fromJSON(e)) : [], + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", + duplicateAction: isSet(object.duplicateAction) + ? globalThis.String(object.duplicateAction) + : isSet(object.duplicate_action) + ? globalThis.String(object.duplicate_action) + : "", }; }, - toJSON(message: ListLookupMasterColumnsResponse): unknown { + toJSON(message: ImportMbParamsRequest): unknown { const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); } - if (message.data?.length) { - obj.data = message.data.map((e) => LookupMasterColumn.toJSON(e)); + if (message.fileName !== "") { + obj.fileName = message.fileName; + } + if (message.duplicateAction !== "") { + obj.duplicateAction = message.duplicateAction; } return obj; }, - create(base?: DeepPartial): ListLookupMasterColumnsResponse { - return ListLookupMasterColumnsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ImportMbParamsRequest { + return ImportMbParamsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListLookupMasterColumnsResponse { - const message = createBaseListLookupMasterColumnsResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.data = object.data?.map((e) => LookupMasterColumn.fromPartial(e)) || []; + fromPartial(object: DeepPartial): ImportMbParamsRequest { + const message = createBaseImportMbParamsRequest(); + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; + message.duplicateAction = object.duplicateAction ?? ""; return message; }, }; -function createBaseCreateLookupMasterRequest(): CreateLookupMasterRequest { - return { lmCode: "", lmDisplayName: "", lmApiPath: "", lmCodeField: "", lmLabelField: "", lmTableName: undefined }; +function createBaseImportMbParamsResponse(): ImportMbParamsResponse { + return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; } -export const CreateLookupMasterRequest: MessageFns = { - encode(message: CreateLookupMasterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.lmCode !== "") { - writer.uint32(10).string(message.lmCode); - } - if (message.lmDisplayName !== "") { - writer.uint32(18).string(message.lmDisplayName); +export const ImportMbParamsResponse: MessageFns = { + encode(message: ImportMbParamsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.lmApiPath !== "") { - writer.uint32(26).string(message.lmApiPath); + if (message.successCount !== 0) { + writer.uint32(16).int32(message.successCount); } - if (message.lmCodeField !== "") { - writer.uint32(34).string(message.lmCodeField); + if (message.skippedCount !== 0) { + writer.uint32(24).int32(message.skippedCount); } - if (message.lmLabelField !== "") { - writer.uint32(42).string(message.lmLabelField); + if (message.failedCount !== 0) { + writer.uint32(32).int32(message.failedCount); } - if (message.lmTableName !== undefined) { - writer.uint32(50).string(message.lmTableName); + for (const v of message.errors) { + ImportError.encode(v!, writer.uint32(42).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateLookupMasterRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ImportMbParamsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateLookupMasterRequest(); + const message = createBaseImportMbParamsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -17594,31 +27282,31 @@ export const CreateLookupMasterRequest: MessageFns = break; } - message.lmCode = reader.string(); + message.base = BaseResponse.decode(reader, reader.uint32()); continue; } case 2: { - if (tag !== 18) { + if (tag !== 16) { break; } - message.lmDisplayName = reader.string(); + message.successCount = reader.int32(); continue; } case 3: { - if (tag !== 26) { + if (tag !== 24) { break; } - message.lmApiPath = reader.string(); + message.skippedCount = reader.int32(); continue; } case 4: { - if (tag !== 34) { + if (tag !== 32) { break; } - message.lmCodeField = reader.string(); + message.failedCount = reader.int32(); continue; } case 5: { @@ -17626,17 +27314,92 @@ export const CreateLookupMasterRequest: MessageFns = break; } - message.lmLabelField = reader.string(); + message.errors.push(ImportError.decode(reader, reader.uint32())); continue; } - case 6: { - if (tag !== 50) { - break; - } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): ImportMbParamsResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + successCount: isSet(object.successCount) + ? globalThis.Number(object.successCount) + : isSet(object.success_count) + ? globalThis.Number(object.success_count) + : 0, + skippedCount: isSet(object.skippedCount) + ? globalThis.Number(object.skippedCount) + : isSet(object.skipped_count) + ? globalThis.Number(object.skipped_count) + : 0, + failedCount: isSet(object.failedCount) + ? globalThis.Number(object.failedCount) + : isSet(object.failed_count) + ? globalThis.Number(object.failed_count) + : 0, + errors: globalThis.Array.isArray(object?.errors) ? object.errors.map((e: any) => ImportError.fromJSON(e)) : [], + }; + }, + + toJSON(message: ImportMbParamsResponse): unknown { + const obj: any = {}; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.successCount !== 0) { + obj.successCount = Math.round(message.successCount); + } + if (message.skippedCount !== 0) { + obj.skippedCount = Math.round(message.skippedCount); + } + if (message.failedCount !== 0) { + obj.failedCount = Math.round(message.failedCount); + } + if (message.errors?.length) { + obj.errors = message.errors.map((e) => ImportError.toJSON(e)); + } + return obj; + }, + + create(base?: DeepPartial): ImportMbParamsResponse { + return ImportMbParamsResponse.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): ImportMbParamsResponse { + const message = createBaseImportMbParamsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.successCount = object.successCount ?? 0; + message.skippedCount = object.skippedCount ?? 0; + message.failedCount = object.failedCount ?? 0; + message.errors = object.errors?.map((e) => ImportError.fromPartial(e)) || []; + return message; + }, +}; - message.lmTableName = reader.string(); - continue; - } +function createBaseDownloadMbParamTemplateRequest(): DownloadMbParamTemplateRequest { + return {}; +} + +export const DownloadMbParamTemplateRequest: MessageFns = { + encode(_: DownloadMbParamTemplateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): DownloadMbParamTemplateRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDownloadMbParamTemplateRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { } if ((tag & 7) === 4 || tag === 0) { break; @@ -17646,98 +27409,46 @@ export const CreateLookupMasterRequest: MessageFns = return message; }, - fromJSON(object: any): CreateLookupMasterRequest { - return { - lmCode: isSet(object.lmCode) - ? globalThis.String(object.lmCode) - : isSet(object.lm_code) - ? globalThis.String(object.lm_code) - : "", - lmDisplayName: isSet(object.lmDisplayName) - ? globalThis.String(object.lmDisplayName) - : isSet(object.lm_display_name) - ? globalThis.String(object.lm_display_name) - : "", - lmApiPath: isSet(object.lmApiPath) - ? globalThis.String(object.lmApiPath) - : isSet(object.lm_api_path) - ? globalThis.String(object.lm_api_path) - : "", - lmCodeField: isSet(object.lmCodeField) - ? globalThis.String(object.lmCodeField) - : isSet(object.lm_code_field) - ? globalThis.String(object.lm_code_field) - : "", - lmLabelField: isSet(object.lmLabelField) - ? globalThis.String(object.lmLabelField) - : isSet(object.lm_label_field) - ? globalThis.String(object.lm_label_field) - : "", - lmTableName: isSet(object.lmTableName) - ? globalThis.String(object.lmTableName) - : isSet(object.lm_table_name) - ? globalThis.String(object.lm_table_name) - : undefined, - }; + fromJSON(_: any): DownloadMbParamTemplateRequest { + return {}; }, - toJSON(message: CreateLookupMasterRequest): unknown { + toJSON(_: DownloadMbParamTemplateRequest): unknown { const obj: any = {}; - if (message.lmCode !== "") { - obj.lmCode = message.lmCode; - } - if (message.lmDisplayName !== "") { - obj.lmDisplayName = message.lmDisplayName; - } - if (message.lmApiPath !== "") { - obj.lmApiPath = message.lmApiPath; - } - if (message.lmCodeField !== "") { - obj.lmCodeField = message.lmCodeField; - } - if (message.lmLabelField !== "") { - obj.lmLabelField = message.lmLabelField; - } - if (message.lmTableName !== undefined) { - obj.lmTableName = message.lmTableName; - } return obj; }, - create(base?: DeepPartial): CreateLookupMasterRequest { - return CreateLookupMasterRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): DownloadMbParamTemplateRequest { + return DownloadMbParamTemplateRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateLookupMasterRequest { - const message = createBaseCreateLookupMasterRequest(); - message.lmCode = object.lmCode ?? ""; - message.lmDisplayName = object.lmDisplayName ?? ""; - message.lmApiPath = object.lmApiPath ?? ""; - message.lmCodeField = object.lmCodeField ?? ""; - message.lmLabelField = object.lmLabelField ?? ""; - message.lmTableName = object.lmTableName ?? undefined; + fromPartial(_: DeepPartial): DownloadMbParamTemplateRequest { + const message = createBaseDownloadMbParamTemplateRequest(); return message; }, }; -function createBaseCreateLookupMasterResponse(): CreateLookupMasterResponse { - return { base: undefined, data: undefined }; +function createBaseDownloadMbParamTemplateResponse(): DownloadMbParamTemplateResponse { + return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; } -export const CreateLookupMasterResponse: MessageFns = { - encode(message: CreateLookupMasterResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DownloadMbParamTemplateResponse: MessageFns = { + encode(message: DownloadMbParamTemplateResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.data !== undefined) { - LookupMaster.encode(message.data, writer.uint32(18).fork()).join(); + if (message.fileContent.length !== 0) { + writer.uint32(18).bytes(message.fileContent); + } + if (message.fileName !== "") { + writer.uint32(26).string(message.fileName); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateLookupMasterResponse { + decode(input: BinaryReader | Uint8Array, length?: number): DownloadMbParamTemplateResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateLookupMasterResponse(); + const message = createBaseDownloadMbParamTemplateResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -17754,7 +27465,15 @@ export const CreateLookupMasterResponse: MessageFns break; } - message.data = LookupMaster.decode(reader, reader.uint32()); + message.fileContent = reader.bytes(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.fileName = reader.string(); continue; } } @@ -17766,55 +27485,81 @@ export const CreateLookupMasterResponse: MessageFns return message; }, - fromJSON(object: any): CreateLookupMasterResponse { + fromJSON(object: any): DownloadMbParamTemplateResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? LookupMaster.fromJSON(object.data) : undefined, + fileContent: isSet(object.fileContent) + ? bytesFromBase64(object.fileContent) + : isSet(object.file_content) + ? bytesFromBase64(object.file_content) + : new Uint8Array(0), + fileName: isSet(object.fileName) + ? globalThis.String(object.fileName) + : isSet(object.file_name) + ? globalThis.String(object.file_name) + : "", }; }, - toJSON(message: CreateLookupMasterResponse): unknown { + toJSON(message: DownloadMbParamTemplateResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data !== undefined) { - obj.data = LookupMaster.toJSON(message.data); + if (message.fileContent.length !== 0) { + obj.fileContent = base64FromBytes(message.fileContent); + } + if (message.fileName !== "") { + obj.fileName = message.fileName; } return obj; }, - create(base?: DeepPartial): CreateLookupMasterResponse { - return CreateLookupMasterResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): DownloadMbParamTemplateResponse { + return DownloadMbParamTemplateResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateLookupMasterResponse { - const message = createBaseCreateLookupMasterResponse(); + fromPartial(object: DeepPartial): DownloadMbParamTemplateResponse { + const message = createBaseDownloadMbParamTemplateResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? LookupMaster.fromPartial(object.data) - : undefined; + message.fileContent = object.fileContent ?? new Uint8Array(0); + message.fileName = object.fileName ?? ""; return message; }, }; -function createBaseDeleteLookupMasterRequest(): DeleteLookupMasterRequest { - return { lmCode: "" }; +function createBaseCreateMbParamOptionRequest(): CreateMbParamOptionRequest { + return { mbpCode: "", code: "", numericValue: "", description: "", displayOrder: 0, isActive: false }; } -export const DeleteLookupMasterRequest: MessageFns = { - encode(message: DeleteLookupMasterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.lmCode !== "") { - writer.uint32(10).string(message.lmCode); +export const CreateMbParamOptionRequest: MessageFns = { + encode(message: CreateMbParamOptionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbpCode !== "") { + writer.uint32(10).string(message.mbpCode); + } + if (message.code !== "") { + writer.uint32(18).string(message.code); + } + if (message.numericValue !== "") { + writer.uint32(26).string(message.numericValue); + } + if (message.description !== "") { + writer.uint32(34).string(message.description); + } + if (message.displayOrder !== 0) { + writer.uint32(40).int32(message.displayOrder); + } + if (message.isActive !== false) { + writer.uint32(48).bool(message.isActive); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteLookupMasterRequest { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMbParamOptionRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteLookupMasterRequest(); + const message = createBaseCreateMbParamOptionRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -17823,7 +27568,47 @@ export const DeleteLookupMasterRequest: MessageFns = break; } - message.lmCode = reader.string(); + message.mbpCode = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.code = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.numericValue = reader.string(); + continue; + } + case 4: { + if (tag !== 34) { + break; + } + + message.description = reader.string(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.displayOrder = reader.int32(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.isActive = reader.bool(); continue; } } @@ -17835,50 +27620,90 @@ export const DeleteLookupMasterRequest: MessageFns = return message; }, - fromJSON(object: any): DeleteLookupMasterRequest { + fromJSON(object: any): CreateMbParamOptionRequest { return { - lmCode: isSet(object.lmCode) - ? globalThis.String(object.lmCode) - : isSet(object.lm_code) - ? globalThis.String(object.lm_code) + mbpCode: isSet(object.mbpCode) + ? globalThis.String(object.mbpCode) + : isSet(object.mbp_code) + ? globalThis.String(object.mbp_code) : "", + code: isSet(object.code) ? globalThis.String(object.code) : "", + numericValue: isSet(object.numericValue) + ? globalThis.String(object.numericValue) + : isSet(object.numeric_value) + ? globalThis.String(object.numeric_value) + : "", + description: isSet(object.description) ? globalThis.String(object.description) : "", + displayOrder: isSet(object.displayOrder) + ? globalThis.Number(object.displayOrder) + : isSet(object.display_order) + ? globalThis.Number(object.display_order) + : 0, + isActive: isSet(object.isActive) + ? globalThis.Boolean(object.isActive) + : isSet(object.is_active) + ? globalThis.Boolean(object.is_active) + : false, }; }, - toJSON(message: DeleteLookupMasterRequest): unknown { + toJSON(message: CreateMbParamOptionRequest): unknown { const obj: any = {}; - if (message.lmCode !== "") { - obj.lmCode = message.lmCode; + if (message.mbpCode !== "") { + obj.mbpCode = message.mbpCode; + } + if (message.code !== "") { + obj.code = message.code; + } + if (message.numericValue !== "") { + obj.numericValue = message.numericValue; + } + if (message.description !== "") { + obj.description = message.description; + } + if (message.displayOrder !== 0) { + obj.displayOrder = Math.round(message.displayOrder); + } + if (message.isActive !== false) { + obj.isActive = message.isActive; } return obj; }, - create(base?: DeepPartial): DeleteLookupMasterRequest { - return DeleteLookupMasterRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMbParamOptionRequest { + return CreateMbParamOptionRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteLookupMasterRequest { - const message = createBaseDeleteLookupMasterRequest(); - message.lmCode = object.lmCode ?? ""; + fromPartial(object: DeepPartial): CreateMbParamOptionRequest { + const message = createBaseCreateMbParamOptionRequest(); + message.mbpCode = object.mbpCode ?? ""; + message.code = object.code ?? ""; + message.numericValue = object.numericValue ?? ""; + message.description = object.description ?? ""; + message.displayOrder = object.displayOrder ?? 0; + message.isActive = object.isActive ?? false; return message; }, }; -function createBaseDeleteLookupMasterResponse(): DeleteLookupMasterResponse { - return { base: undefined }; +function createBaseCreateMbParamOptionResponse(): CreateMbParamOptionResponse { + return { base: undefined, data: undefined }; } -export const DeleteLookupMasterResponse: MessageFns = { - encode(message: DeleteLookupMasterResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const CreateMbParamOptionResponse: MessageFns = { + encode(message: CreateMbParamOptionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } + if (message.data !== undefined) { + MbParamOption.encode(message.data, writer.uint32(18).fork()).join(); + } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteLookupMasterResponse { + decode(input: BinaryReader | Uint8Array, length?: number): CreateMbParamOptionResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteLookupMasterResponse(); + const message = createBaseCreateMbParamOptionResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -17890,6 +27715,14 @@ export const DeleteLookupMasterResponse: MessageFns message.base = BaseResponse.decode(reader, reader.uint32()); continue; } + case 2: { + if (tag !== 18) { + break; + } + + message.data = MbParamOption.decode(reader, reader.uint32()); + continue; + } } if ((tag & 7) === 4 || tag === 0) { break; @@ -17899,58 +27732,67 @@ export const DeleteLookupMasterResponse: MessageFns return message; }, - fromJSON(object: any): DeleteLookupMasterResponse { - return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined }; + fromJSON(object: any): CreateMbParamOptionResponse { + return { + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? MbParamOption.fromJSON(object.data) : undefined, + }; }, - toJSON(message: DeleteLookupMasterResponse): unknown { + toJSON(message: CreateMbParamOptionResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } + if (message.data !== undefined) { + obj.data = MbParamOption.toJSON(message.data); + } return obj; }, - create(base?: DeepPartial): DeleteLookupMasterResponse { - return DeleteLookupMasterResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): CreateMbParamOptionResponse { + return CreateMbParamOptionResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteLookupMasterResponse { - const message = createBaseDeleteLookupMasterResponse(); + fromPartial(object: DeepPartial): CreateMbParamOptionResponse { + const message = createBaseCreateMbParamOptionResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; + message.data = (object.data !== undefined && object.data !== null) + ? MbParamOption.fromPartial(object.data) + : undefined; return message; }, }; -function createBaseCreateLookupMasterColumnRequest(): CreateLookupMasterColumnRequest { - return { lmcMasterCode: "", lmcColumnName: "", lmcDisplayName: "", lmcDataType: "", lmcSortOrder: 0 }; +function createBaseUpdateMbParamOptionRequest(): UpdateMbParamOptionRequest { + return { mbpoId: "", numericValue: "", description: "", displayOrder: 0, isActive: false }; } -export const CreateLookupMasterColumnRequest: MessageFns = { - encode(message: CreateLookupMasterColumnRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.lmcMasterCode !== "") { - writer.uint32(10).string(message.lmcMasterCode); - } - if (message.lmcColumnName !== "") { - writer.uint32(18).string(message.lmcColumnName); +export const UpdateMbParamOptionRequest: MessageFns = { + encode(message: UpdateMbParamOptionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbpoId !== "") { + writer.uint32(10).string(message.mbpoId); } - if (message.lmcDisplayName !== "") { - writer.uint32(26).string(message.lmcDisplayName); + if (message.numericValue !== "") { + writer.uint32(18).string(message.numericValue); } - if (message.lmcDataType !== "") { - writer.uint32(34).string(message.lmcDataType); + if (message.description !== "") { + writer.uint32(26).string(message.description); } - if (message.lmcSortOrder !== 0) { - writer.uint32(40).int32(message.lmcSortOrder); + if (message.displayOrder !== 0) { + writer.uint32(32).int32(message.displayOrder); + } + if (message.isActive !== false) { + writer.uint32(40).bool(message.isActive); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateLookupMasterColumnRequest { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMbParamOptionRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateLookupMasterColumnRequest(); + const message = createBaseUpdateMbParamOptionRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -17959,7 +27801,7 @@ export const CreateLookupMasterColumnRequest: MessageFns): CreateLookupMasterColumnRequest { - return CreateLookupMasterColumnRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateMbParamOptionRequest { + return UpdateMbParamOptionRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateLookupMasterColumnRequest { - const message = createBaseCreateLookupMasterColumnRequest(); - message.lmcMasterCode = object.lmcMasterCode ?? ""; - message.lmcColumnName = object.lmcColumnName ?? ""; - message.lmcDisplayName = object.lmcDisplayName ?? ""; - message.lmcDataType = object.lmcDataType ?? ""; - message.lmcSortOrder = object.lmcSortOrder ?? 0; + fromPartial(object: DeepPartial): UpdateMbParamOptionRequest { + const message = createBaseUpdateMbParamOptionRequest(); + message.mbpoId = object.mbpoId ?? ""; + message.numericValue = object.numericValue ?? ""; + message.description = object.description ?? ""; + message.displayOrder = object.displayOrder ?? 0; + message.isActive = object.isActive ?? false; return message; }, }; -function createBaseCreateLookupMasterColumnResponse(): CreateLookupMasterColumnResponse { +function createBaseUpdateMbParamOptionResponse(): UpdateMbParamOptionResponse { return { base: undefined, data: undefined }; } -export const CreateLookupMasterColumnResponse: MessageFns = { - encode(message: CreateLookupMasterColumnResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const UpdateMbParamOptionResponse: MessageFns = { + encode(message: UpdateMbParamOptionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } if (message.data !== undefined) { - LookupMasterColumn.encode(message.data, writer.uint32(18).fork()).join(); + MbParamOption.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): CreateLookupMasterColumnResponse { + decode(input: BinaryReader | Uint8Array, length?: number): UpdateMbParamOptionResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCreateLookupMasterColumnResponse(); + const message = createBaseUpdateMbParamOptionResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -18102,7 +27940,7 @@ export const CreateLookupMasterColumnResponse: MessageFns): CreateLookupMasterColumnResponse { - return CreateLookupMasterColumnResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): UpdateMbParamOptionResponse { + return UpdateMbParamOptionResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): CreateLookupMasterColumnResponse { - const message = createBaseCreateLookupMasterColumnResponse(); + fromPartial(object: DeepPartial): UpdateMbParamOptionResponse { + const message = createBaseUpdateMbParamOptionResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; message.data = (object.data !== undefined && object.data !== null) - ? LookupMasterColumn.fromPartial(object.data) + ? MbParamOption.fromPartial(object.data) : undefined; return message; }, }; -function createBaseDeleteLookupMasterColumnRequest(): DeleteLookupMasterColumnRequest { - return { lmcId: "" }; +function createBaseDeleteMbParamOptionRequest(): DeleteMbParamOptionRequest { + return { mbpoId: "" }; } -export const DeleteLookupMasterColumnRequest: MessageFns = { - encode(message: DeleteLookupMasterColumnRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.lmcId !== "") { - writer.uint32(10).string(message.lmcId); +export const DeleteMbParamOptionRequest: MessageFns = { + encode(message: DeleteMbParamOptionRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbpoId !== "") { + writer.uint32(10).string(message.mbpoId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteLookupMasterColumnRequest { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMbParamOptionRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteLookupMasterColumnRequest(); + const message = createBaseDeleteMbParamOptionRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -18171,7 +28009,7 @@ export const DeleteLookupMasterColumnRequest: MessageFns): DeleteLookupMasterColumnRequest { - return DeleteLookupMasterColumnRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMbParamOptionRequest { + return DeleteMbParamOptionRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteLookupMasterColumnRequest { - const message = createBaseDeleteLookupMasterColumnRequest(); - message.lmcId = object.lmcId ?? ""; + fromPartial(object: DeepPartial): DeleteMbParamOptionRequest { + const message = createBaseDeleteMbParamOptionRequest(); + message.mbpoId = object.mbpoId ?? ""; return message; }, }; -function createBaseDeleteLookupMasterColumnResponse(): DeleteLookupMasterColumnResponse { +function createBaseDeleteMbParamOptionResponse(): DeleteMbParamOptionResponse { return { base: undefined }; } -export const DeleteLookupMasterColumnResponse: MessageFns = { - encode(message: DeleteLookupMasterColumnResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const DeleteMbParamOptionResponse: MessageFns = { + encode(message: DeleteMbParamOptionResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): DeleteLookupMasterColumnResponse { + decode(input: BinaryReader | Uint8Array, length?: number): DeleteMbParamOptionResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDeleteLookupMasterColumnResponse(); + const message = createBaseDeleteMbParamOptionResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -18247,11 +28085,11 @@ export const DeleteLookupMasterColumnResponse: MessageFns): DeleteLookupMasterColumnResponse { - return DeleteLookupMasterColumnResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): DeleteMbParamOptionResponse { + return DeleteMbParamOptionResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): DeleteLookupMasterColumnResponse { - const message = createBaseDeleteLookupMasterColumnResponse(); + fromPartial(object: DeepPartial): DeleteMbParamOptionResponse { + const message = createBaseDeleteMbParamOptionResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; @@ -18271,31 +28109,245 @@ export const DeleteLookupMasterColumnResponse: MessageFns = { - encode(message: UpdateLookupMasterRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.lmCode !== "") { - writer.uint32(10).string(message.lmCode); +export const PreviewPushToHeadRequest: MessageFns = { + encode(message: PreviewPushToHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.period !== "") { + writer.uint32(10).string(message.period); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PreviewPushToHeadRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePreviewPushToHeadRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.period = reader.string(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PreviewPushToHeadRequest { + return { period: isSet(object.period) ? globalThis.String(object.period) : "" }; + }, + + toJSON(message: PreviewPushToHeadRequest): unknown { + const obj: any = {}; + if (message.period !== "") { + obj.period = message.period; + } + return obj; + }, + + create(base?: DeepPartial): PreviewPushToHeadRequest { + return PreviewPushToHeadRequest.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PreviewPushToHeadRequest { + const message = createBasePreviewPushToHeadRequest(); + message.period = object.period ?? ""; + return message; + }, +}; + +function createBasePushableMbHead(): PushableMbHead { + return { mbhId: "", code: "", name: "", hasActual: false, hasSelling: false, hasForecast: false }; +} + +export const PushableMbHead: MessageFns = { + encode(message: PushableMbHead, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); + } + if (message.code !== "") { + writer.uint32(18).string(message.code); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.hasActual !== false) { + writer.uint32(32).bool(message.hasActual); + } + if (message.hasSelling !== false) { + writer.uint32(40).bool(message.hasSelling); + } + if (message.hasForecast !== false) { + writer.uint32(48).bool(message.hasForecast); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): PushableMbHead { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePushableMbHead(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: { + if (tag !== 10) { + break; + } + + message.mbhId = reader.string(); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.code = reader.string(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.name = reader.string(); + continue; + } + case 4: { + if (tag !== 32) { + break; + } + + message.hasActual = reader.bool(); + continue; + } + case 5: { + if (tag !== 40) { + break; + } + + message.hasSelling = reader.bool(); + continue; + } + case 6: { + if (tag !== 48) { + break; + } + + message.hasForecast = reader.bool(); + continue; + } + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): PushableMbHead { + return { + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) + : "", + code: isSet(object.code) ? globalThis.String(object.code) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + hasActual: isSet(object.hasActual) + ? globalThis.Boolean(object.hasActual) + : isSet(object.has_actual) + ? globalThis.Boolean(object.has_actual) + : false, + hasSelling: isSet(object.hasSelling) + ? globalThis.Boolean(object.hasSelling) + : isSet(object.has_selling) + ? globalThis.Boolean(object.has_selling) + : false, + hasForecast: isSet(object.hasForecast) + ? globalThis.Boolean(object.hasForecast) + : isSet(object.has_forecast) + ? globalThis.Boolean(object.has_forecast) + : false, + }; + }, + + toJSON(message: PushableMbHead): unknown { + const obj: any = {}; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; + } + if (message.code !== "") { + obj.code = message.code; + } + if (message.name !== "") { + obj.name = message.name; + } + if (message.hasActual !== false) { + obj.hasActual = message.hasActual; + } + if (message.hasSelling !== false) { + obj.hasSelling = message.hasSelling; + } + if (message.hasForecast !== false) { + obj.hasForecast = message.hasForecast; + } + return obj; + }, + + create(base?: DeepPartial): PushableMbHead { + return PushableMbHead.fromPartial(base ?? {}); + }, + fromPartial(object: DeepPartial): PushableMbHead { + const message = createBasePushableMbHead(); + message.mbhId = object.mbhId ?? ""; + message.code = object.code ?? ""; + message.name = object.name ?? ""; + message.hasActual = object.hasActual ?? false; + message.hasSelling = object.hasSelling ?? false; + message.hasForecast = object.hasForecast ?? false; + return message; + }, +}; + +function createBaseSkippedMbHead(): SkippedMbHead { + return { mbhId: "", code: "", name: "", reason: "" }; +} + +export const SkippedMbHead: MessageFns = { + encode(message: SkippedMbHead, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } - if (message.lmDisplayName !== undefined) { - writer.uint32(18).string(message.lmDisplayName); + if (message.code !== "") { + writer.uint32(18).string(message.code); } - if (message.lmTableName !== undefined) { - writer.uint32(26).string(message.lmTableName); + if (message.name !== "") { + writer.uint32(26).string(message.name); } - if (message.lmIsActive !== undefined) { - writer.uint32(32).bool(message.lmIsActive); + if (message.reason !== "") { + writer.uint32(34).string(message.reason); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateLookupMasterRequest { + decode(input: BinaryReader | Uint8Array, length?: number): SkippedMbHead { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateLookupMasterRequest(); + const message = createBaseSkippedMbHead(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -18304,7 +28356,7 @@ export const UpdateLookupMasterRequest: MessageFns = break; } - message.lmCode = reader.string(); + message.mbhId = reader.string(); continue; } case 2: { @@ -18312,7 +28364,7 @@ export const UpdateLookupMasterRequest: MessageFns = break; } - message.lmDisplayName = reader.string(); + message.code = reader.string(); continue; } case 3: { @@ -18320,15 +28372,15 @@ export const UpdateLookupMasterRequest: MessageFns = break; } - message.lmTableName = reader.string(); + message.name = reader.string(); continue; } case 4: { - if (tag !== 32) { + if (tag !== 34) { break; } - message.lmIsActive = reader.bool(); + message.reason = reader.string(); continue; } } @@ -18340,80 +28392,71 @@ export const UpdateLookupMasterRequest: MessageFns = return message; }, - fromJSON(object: any): UpdateLookupMasterRequest { + fromJSON(object: any): SkippedMbHead { return { - lmCode: isSet(object.lmCode) - ? globalThis.String(object.lmCode) - : isSet(object.lm_code) - ? globalThis.String(object.lm_code) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) : "", - lmDisplayName: isSet(object.lmDisplayName) - ? globalThis.String(object.lmDisplayName) - : isSet(object.lm_display_name) - ? globalThis.String(object.lm_display_name) - : undefined, - lmTableName: isSet(object.lmTableName) - ? globalThis.String(object.lmTableName) - : isSet(object.lm_table_name) - ? globalThis.String(object.lm_table_name) - : undefined, - lmIsActive: isSet(object.lmIsActive) - ? globalThis.Boolean(object.lmIsActive) - : isSet(object.lm_is_active) - ? globalThis.Boolean(object.lm_is_active) - : undefined, + code: isSet(object.code) ? globalThis.String(object.code) : "", + name: isSet(object.name) ? globalThis.String(object.name) : "", + reason: isSet(object.reason) ? globalThis.String(object.reason) : "", }; }, - toJSON(message: UpdateLookupMasterRequest): unknown { + toJSON(message: SkippedMbHead): unknown { const obj: any = {}; - if (message.lmCode !== "") { - obj.lmCode = message.lmCode; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } - if (message.lmDisplayName !== undefined) { - obj.lmDisplayName = message.lmDisplayName; + if (message.code !== "") { + obj.code = message.code; } - if (message.lmTableName !== undefined) { - obj.lmTableName = message.lmTableName; + if (message.name !== "") { + obj.name = message.name; } - if (message.lmIsActive !== undefined) { - obj.lmIsActive = message.lmIsActive; + if (message.reason !== "") { + obj.reason = message.reason; } return obj; }, - create(base?: DeepPartial): UpdateLookupMasterRequest { - return UpdateLookupMasterRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): SkippedMbHead { + return SkippedMbHead.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateLookupMasterRequest { - const message = createBaseUpdateLookupMasterRequest(); - message.lmCode = object.lmCode ?? ""; - message.lmDisplayName = object.lmDisplayName ?? undefined; - message.lmTableName = object.lmTableName ?? undefined; - message.lmIsActive = object.lmIsActive ?? undefined; + fromPartial(object: DeepPartial): SkippedMbHead { + const message = createBaseSkippedMbHead(); + message.mbhId = object.mbhId ?? ""; + message.code = object.code ?? ""; + message.name = object.name ?? ""; + message.reason = object.reason ?? ""; return message; }, }; -function createBaseUpdateLookupMasterResponse(): UpdateLookupMasterResponse { - return { base: undefined, data: undefined }; +function createBasePreviewPushToHeadResponse(): PreviewPushToHeadResponse { + return { base: undefined, pushable: [], skipped: [] }; } -export const UpdateLookupMasterResponse: MessageFns = { - encode(message: UpdateLookupMasterResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const PreviewPushToHeadResponse: MessageFns = { + encode(message: PreviewPushToHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.data !== undefined) { - LookupMaster.encode(message.data, writer.uint32(18).fork()).join(); + for (const v of message.pushable) { + PushableMbHead.encode(v!, writer.uint32(18).fork()).join(); + } + for (const v of message.skipped) { + SkippedMbHead.encode(v!, writer.uint32(26).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): UpdateLookupMasterResponse { + decode(input: BinaryReader | Uint8Array, length?: number): PreviewPushToHeadResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateLookupMasterResponse(); + const message = createBasePreviewPushToHeadResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -18430,7 +28473,15 @@ export const UpdateLookupMasterResponse: MessageFns break; } - message.data = LookupMaster.decode(reader, reader.uint32()); + message.pushable.push(PushableMbHead.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.skipped.push(SkippedMbHead.decode(reader, reader.uint32())); continue; } } @@ -18442,64 +28493,65 @@ export const UpdateLookupMasterResponse: MessageFns return message; }, - fromJSON(object: any): UpdateLookupMasterResponse { + fromJSON(object: any): PreviewPushToHeadResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: isSet(object.data) ? LookupMaster.fromJSON(object.data) : undefined, + pushable: globalThis.Array.isArray(object?.pushable) + ? object.pushable.map((e: any) => PushableMbHead.fromJSON(e)) + : [], + skipped: globalThis.Array.isArray(object?.skipped) + ? object.skipped.map((e: any) => SkippedMbHead.fromJSON(e)) + : [], }; }, - toJSON(message: UpdateLookupMasterResponse): unknown { + toJSON(message: PreviewPushToHeadResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } - if (message.data !== undefined) { - obj.data = LookupMaster.toJSON(message.data); + if (message.pushable?.length) { + obj.pushable = message.pushable.map((e) => PushableMbHead.toJSON(e)); + } + if (message.skipped?.length) { + obj.skipped = message.skipped.map((e) => SkippedMbHead.toJSON(e)); } return obj; }, - create(base?: DeepPartial): UpdateLookupMasterResponse { - return UpdateLookupMasterResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): PreviewPushToHeadResponse { + return PreviewPushToHeadResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): UpdateLookupMasterResponse { - const message = createBaseUpdateLookupMasterResponse(); + fromPartial(object: DeepPartial): PreviewPushToHeadResponse { + const message = createBasePreviewPushToHeadResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = (object.data !== undefined && object.data !== null) - ? LookupMaster.fromPartial(object.data) - : undefined; + message.pushable = object.pushable?.map((e) => PushableMbHead.fromPartial(e)) || []; + message.skipped = object.skipped?.map((e) => SkippedMbHead.fromPartial(e)) || []; return message; }, }; -function createBaseTableColumn(): TableColumn { - return { columnName: "", dataType: "", rawType: "", ordinalPosition: 0 }; +function createBaseExecutePushToHeadRequest(): ExecutePushToHeadRequest { + return { period: "", mbHeadIds: [] }; } -export const TableColumn: MessageFns = { - encode(message: TableColumn, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.columnName !== "") { - writer.uint32(10).string(message.columnName); - } - if (message.dataType !== "") { - writer.uint32(18).string(message.dataType); +export const ExecutePushToHeadRequest: MessageFns = { + encode(message: ExecutePushToHeadRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.period !== "") { + writer.uint32(10).string(message.period); } - if (message.rawType !== "") { - writer.uint32(26).string(message.rawType); - } - if (message.ordinalPosition !== 0) { - writer.uint32(32).int32(message.ordinalPosition); + for (const v of message.mbHeadIds) { + writer.uint32(18).string(v!); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): TableColumn { + decode(input: BinaryReader | Uint8Array, length?: number): ExecutePushToHeadRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseTableColumn(); + const message = createBaseExecutePushToHeadRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -18508,7 +28560,7 @@ export const TableColumn: MessageFns = { break; } - message.columnName = reader.string(); + message.period = reader.string(); continue; } case 2: { @@ -18516,23 +28568,7 @@ export const TableColumn: MessageFns = { break; } - message.dataType = reader.string(); - continue; - } - case 3: { - if (tag !== 26) { - break; - } - - message.rawType = reader.string(); - continue; - } - case 4: { - if (tag !== 32) { - break; - } - - message.ordinalPosition = reader.int32(); + message.mbHeadIds.push(reader.string()); continue; } } @@ -18544,77 +28580,58 @@ export const TableColumn: MessageFns = { return message; }, - fromJSON(object: any): TableColumn { + fromJSON(object: any): ExecutePushToHeadRequest { return { - columnName: isSet(object.columnName) - ? globalThis.String(object.columnName) - : isSet(object.column_name) - ? globalThis.String(object.column_name) - : "", - dataType: isSet(object.dataType) - ? globalThis.String(object.dataType) - : isSet(object.data_type) - ? globalThis.String(object.data_type) - : "", - rawType: isSet(object.rawType) - ? globalThis.String(object.rawType) - : isSet(object.raw_type) - ? globalThis.String(object.raw_type) - : "", - ordinalPosition: isSet(object.ordinalPosition) - ? globalThis.Number(object.ordinalPosition) - : isSet(object.ordinal_position) - ? globalThis.Number(object.ordinal_position) - : 0, + period: isSet(object.period) ? globalThis.String(object.period) : "", + mbHeadIds: globalThis.Array.isArray(object?.mbHeadIds) + ? object.mbHeadIds.map((e: any) => globalThis.String(e)) + : globalThis.Array.isArray(object?.mb_head_ids) + ? object.mb_head_ids.map((e: any) => globalThis.String(e)) + : [], }; }, - toJSON(message: TableColumn): unknown { + toJSON(message: ExecutePushToHeadRequest): unknown { const obj: any = {}; - if (message.columnName !== "") { - obj.columnName = message.columnName; - } - if (message.dataType !== "") { - obj.dataType = message.dataType; - } - if (message.rawType !== "") { - obj.rawType = message.rawType; + if (message.period !== "") { + obj.period = message.period; } - if (message.ordinalPosition !== 0) { - obj.ordinalPosition = Math.round(message.ordinalPosition); + if (message.mbHeadIds?.length) { + obj.mbHeadIds = message.mbHeadIds; } return obj; }, - create(base?: DeepPartial): TableColumn { - return TableColumn.fromPartial(base ?? {}); + create(base?: DeepPartial): ExecutePushToHeadRequest { + return ExecutePushToHeadRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): TableColumn { - const message = createBaseTableColumn(); - message.columnName = object.columnName ?? ""; - message.dataType = object.dataType ?? ""; - message.rawType = object.rawType ?? ""; - message.ordinalPosition = object.ordinalPosition ?? 0; + fromPartial(object: DeepPartial): ExecutePushToHeadRequest { + const message = createBaseExecutePushToHeadRequest(); + message.period = object.period ?? ""; + message.mbHeadIds = object.mbHeadIds?.map((e) => e) || []; return message; }, }; -function createBaseListTableColumnsRequest(): ListTableColumnsRequest { - return { tableName: "" }; +function createBaseExecutePushToHeadResponse(): ExecutePushToHeadResponse { + return { base: undefined, data: undefined }; } -export const ListTableColumnsRequest: MessageFns = { - encode(message: ListTableColumnsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.tableName !== "") { - writer.uint32(10).string(message.tableName); +export const ExecutePushToHeadResponse: MessageFns = { + encode(message: ExecutePushToHeadResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); + } + if (message.data !== undefined) { + MbPushLog.encode(message.data, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListTableColumnsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ExecutePushToHeadResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListTableColumnsRequest(); + const message = createBaseExecutePushToHeadResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -18623,7 +28640,15 @@ export const ListTableColumnsRequest: MessageFns = { break; } - message.tableName = reader.string(); + message.base = BaseResponse.decode(reader, reader.uint32()); + continue; + } + case 2: { + if (tag !== 18) { + break; + } + + message.data = MbPushLog.decode(reader, reader.uint32()); continue; } } @@ -18635,70 +28660,84 @@ export const ListTableColumnsRequest: MessageFns = { return message; }, - fromJSON(object: any): ListTableColumnsRequest { + fromJSON(object: any): ExecutePushToHeadResponse { return { - tableName: isSet(object.tableName) - ? globalThis.String(object.tableName) - : isSet(object.table_name) - ? globalThis.String(object.table_name) - : "", + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: isSet(object.data) ? MbPushLog.fromJSON(object.data) : undefined, }; }, - toJSON(message: ListTableColumnsRequest): unknown { + toJSON(message: ExecutePushToHeadResponse): unknown { const obj: any = {}; - if (message.tableName !== "") { - obj.tableName = message.tableName; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); + } + if (message.data !== undefined) { + obj.data = MbPushLog.toJSON(message.data); } return obj; }, - create(base?: DeepPartial): ListTableColumnsRequest { - return ListTableColumnsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ExecutePushToHeadResponse { + return ExecutePushToHeadResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListTableColumnsRequest { - const message = createBaseListTableColumnsRequest(); - message.tableName = object.tableName ?? ""; + fromPartial(object: DeepPartial): ExecutePushToHeadResponse { + const message = createBaseExecutePushToHeadResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = (object.data !== undefined && object.data !== null) ? MbPushLog.fromPartial(object.data) : undefined; return message; }, }; -function createBaseListTableColumnsResponse(): ListTableColumnsResponse { - return { base: undefined, data: [] }; +function createBaseListMbPushLogsRequest(): ListMbPushLogsRequest { + return { page: 0, pageSize: 0, period: "" }; } -export const ListTableColumnsResponse: MessageFns = { - encode(message: ListTableColumnsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); +export const ListMbPushLogsRequest: MessageFns = { + encode(message: ListMbPushLogsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.page !== 0) { + writer.uint32(8).int32(message.page); } - for (const v of message.data) { - TableColumn.encode(v!, writer.uint32(18).fork()).join(); + if (message.pageSize !== 0) { + writer.uint32(16).int32(message.pageSize); + } + if (message.period !== "") { + writer.uint32(26).string(message.period); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListTableColumnsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbPushLogsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListTableColumnsResponse(); + const message = createBaseListMbPushLogsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: { - if (tag !== 10) { + if (tag !== 8) { break; } - message.base = BaseResponse.decode(reader, reader.uint32()); + message.page = reader.int32(); continue; } case 2: { - if (tag !== 18) { + if (tag !== 16) { break; } - message.data.push(TableColumn.decode(reader, reader.uint32())); + message.pageSize = reader.int32(); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.period = reader.string(); continue; } } @@ -18710,56 +28749,66 @@ export const ListTableColumnsResponse: MessageFns = { return message; }, - fromJSON(object: any): ListTableColumnsResponse { + fromJSON(object: any): ListMbPushLogsRequest { return { - base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => TableColumn.fromJSON(e)) : [], + page: isSet(object.page) ? globalThis.Number(object.page) : 0, + pageSize: isSet(object.pageSize) + ? globalThis.Number(object.pageSize) + : isSet(object.page_size) + ? globalThis.Number(object.page_size) + : 0, + period: isSet(object.period) ? globalThis.String(object.period) : "", }; }, - toJSON(message: ListTableColumnsResponse): unknown { + toJSON(message: ListMbPushLogsRequest): unknown { const obj: any = {}; - if (message.base !== undefined) { - obj.base = BaseResponse.toJSON(message.base); + if (message.page !== 0) { + obj.page = Math.round(message.page); } - if (message.data?.length) { - obj.data = message.data.map((e) => TableColumn.toJSON(e)); + if (message.pageSize !== 0) { + obj.pageSize = Math.round(message.pageSize); + } + if (message.period !== "") { + obj.period = message.period; } return obj; }, - create(base?: DeepPartial): ListTableColumnsResponse { - return ListTableColumnsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMbPushLogsRequest { + return ListMbPushLogsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListTableColumnsResponse { - const message = createBaseListTableColumnsResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.data = object.data?.map((e) => TableColumn.fromPartial(e)) || []; + fromPartial(object: DeepPartial): ListMbPushLogsRequest { + const message = createBaseListMbPushLogsRequest(); + message.page = object.page ?? 0; + message.pageSize = object.pageSize ?? 0; + message.period = object.period ?? ""; return message; }, }; -function createBaseMasterOption(): MasterOption { - return { value: "", label: "" }; +function createBaseListMbPushLogsResponse(): ListMbPushLogsResponse { + return { base: undefined, data: [], pagination: undefined }; } -export const MasterOption: MessageFns = { - encode(message: MasterOption, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.value !== "") { - writer.uint32(10).string(message.value); +export const ListMbPushLogsResponse: MessageFns = { + encode(message: ListMbPushLogsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.base !== undefined) { + BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.label !== "") { - writer.uint32(18).string(message.label); + for (const v of message.data) { + MbPushLog.encode(v!, writer.uint32(18).fork()).join(); + } + if (message.pagination !== undefined) { + PaginationResponse.encode(message.pagination, writer.uint32(26).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): MasterOption { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbPushLogsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMasterOption(); + const message = createBaseListMbPushLogsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -18768,7 +28817,7 @@ export const MasterOption: MessageFns = { break; } - message.value = reader.string(); + message.base = BaseResponse.decode(reader, reader.uint32()); continue; } case 2: { @@ -18776,7 +28825,15 @@ export const MasterOption: MessageFns = { break; } - message.label = reader.string(); + message.data.push(MbPushLog.decode(reader, reader.uint32())); + continue; + } + case 3: { + if (tag !== 26) { + break; + } + + message.pagination = PaginationResponse.decode(reader, reader.uint32()); continue; } } @@ -18788,51 +28845,60 @@ export const MasterOption: MessageFns = { return message; }, - fromJSON(object: any): MasterOption { + fromJSON(object: any): ListMbPushLogsResponse { return { - value: isSet(object.value) ? globalThis.String(object.value) : "", - label: isSet(object.label) ? globalThis.String(object.label) : "", + base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MbPushLog.fromJSON(e)) : [], + pagination: isSet(object.pagination) ? PaginationResponse.fromJSON(object.pagination) : undefined, }; }, - toJSON(message: MasterOption): unknown { + toJSON(message: ListMbPushLogsResponse): unknown { const obj: any = {}; - if (message.value !== "") { - obj.value = message.value; + if (message.base !== undefined) { + obj.base = BaseResponse.toJSON(message.base); } - if (message.label !== "") { - obj.label = message.label; + if (message.data?.length) { + obj.data = message.data.map((e) => MbPushLog.toJSON(e)); + } + if (message.pagination !== undefined) { + obj.pagination = PaginationResponse.toJSON(message.pagination); } return obj; }, - create(base?: DeepPartial): MasterOption { - return MasterOption.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMbPushLogsResponse { + return ListMbPushLogsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): MasterOption { - const message = createBaseMasterOption(); - message.value = object.value ?? ""; - message.label = object.label ?? ""; + fromPartial(object: DeepPartial): ListMbPushLogsResponse { + const message = createBaseListMbPushLogsResponse(); + message.base = (object.base !== undefined && object.base !== null) + ? BaseResponse.fromPartial(object.base) + : undefined; + message.data = object.data?.map((e) => MbPushLog.fromPartial(e)) || []; + message.pagination = (object.pagination !== undefined && object.pagination !== null) + ? PaginationResponse.fromPartial(object.pagination) + : undefined; return message; }, }; -function createBaseListMasterOptionsRequest(): ListMasterOptionsRequest { - return { masterCode: "" }; +function createBaseListMbWorkflowLogsRequest(): ListMbWorkflowLogsRequest { + return { mbhId: "" }; } -export const ListMasterOptionsRequest: MessageFns = { - encode(message: ListMasterOptionsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.masterCode !== "") { - writer.uint32(10).string(message.masterCode); +export const ListMbWorkflowLogsRequest: MessageFns = { + encode(message: ListMbWorkflowLogsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListMasterOptionsRequest { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbWorkflowLogsRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMasterOptionsRequest(); + const message = createBaseListMbWorkflowLogsRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -18841,7 +28907,7 @@ export const ListMasterOptionsRequest: MessageFns = { break; } - message.masterCode = reader.string(); + message.mbhId = reader.string(); continue; } } @@ -18853,53 +28919,53 @@ export const ListMasterOptionsRequest: MessageFns = { return message; }, - fromJSON(object: any): ListMasterOptionsRequest { + fromJSON(object: any): ListMbWorkflowLogsRequest { return { - masterCode: isSet(object.masterCode) - ? globalThis.String(object.masterCode) - : isSet(object.master_code) - ? globalThis.String(object.master_code) + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) : "", }; }, - toJSON(message: ListMasterOptionsRequest): unknown { + toJSON(message: ListMbWorkflowLogsRequest): unknown { const obj: any = {}; - if (message.masterCode !== "") { - obj.masterCode = message.masterCode; + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } return obj; }, - create(base?: DeepPartial): ListMasterOptionsRequest { - return ListMasterOptionsRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMbWorkflowLogsRequest { + return ListMbWorkflowLogsRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListMasterOptionsRequest { - const message = createBaseListMasterOptionsRequest(); - message.masterCode = object.masterCode ?? ""; + fromPartial(object: DeepPartial): ListMbWorkflowLogsRequest { + const message = createBaseListMbWorkflowLogsRequest(); + message.mbhId = object.mbhId ?? ""; return message; }, }; -function createBaseListMasterOptionsResponse(): ListMasterOptionsResponse { +function createBaseListMbWorkflowLogsResponse(): ListMbWorkflowLogsResponse { return { base: undefined, data: [] }; } -export const ListMasterOptionsResponse: MessageFns = { - encode(message: ListMasterOptionsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const ListMbWorkflowLogsResponse: MessageFns = { + encode(message: ListMbWorkflowLogsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } for (const v of message.data) { - MasterOption.encode(v!, writer.uint32(18).fork()).join(); + MbWorkflowLog.encode(v!, writer.uint32(18).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ListMasterOptionsResponse { + decode(input: BinaryReader | Uint8Array, length?: number): ListMbWorkflowLogsResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseListMasterOptionsResponse(); + const message = createBaseListMbWorkflowLogsResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -18916,7 +28982,7 @@ export const ListMasterOptionsResponse: MessageFns = break; } - message.data.push(MasterOption.decode(reader, reader.uint32())); + message.data.push(MbWorkflowLog.decode(reader, reader.uint32())); continue; } } @@ -18928,102 +28994,53 @@ export const ListMasterOptionsResponse: MessageFns = return message; }, - fromJSON(object: any): ListMasterOptionsResponse { + fromJSON(object: any): ListMbWorkflowLogsResponse { return { base: isSet(object.base) ? BaseResponse.fromJSON(object.base) : undefined, - data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MasterOption.fromJSON(e)) : [], + data: globalThis.Array.isArray(object?.data) ? object.data.map((e: any) => MbWorkflowLog.fromJSON(e)) : [], }; }, - toJSON(message: ListMasterOptionsResponse): unknown { + toJSON(message: ListMbWorkflowLogsResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } if (message.data?.length) { - obj.data = message.data.map((e) => MasterOption.toJSON(e)); + obj.data = message.data.map((e) => MbWorkflowLog.toJSON(e)); } return obj; }, - create(base?: DeepPartial): ListMasterOptionsResponse { - return ListMasterOptionsResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): ListMbWorkflowLogsResponse { + return ListMbWorkflowLogsResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ListMasterOptionsResponse { - const message = createBaseListMasterOptionsResponse(); + fromPartial(object: DeepPartial): ListMbWorkflowLogsResponse { + const message = createBaseListMbWorkflowLogsResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; - message.data = object.data?.map((e) => MasterOption.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseExportLookupMastersRequest(): ExportLookupMastersRequest { - return {}; -} - -export const ExportLookupMastersRequest: MessageFns = { - encode(_: ExportLookupMastersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): ExportLookupMastersRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportLookupMastersRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(_: any): ExportLookupMastersRequest { - return {}; - }, - - toJSON(_: ExportLookupMastersRequest): unknown { - const obj: any = {}; - return obj; - }, - - create(base?: DeepPartial): ExportLookupMastersRequest { - return ExportLookupMastersRequest.fromPartial(base ?? {}); - }, - fromPartial(_: DeepPartial): ExportLookupMastersRequest { - const message = createBaseExportLookupMastersRequest(); + message.data = object.data?.map((e) => MbWorkflowLog.fromPartial(e)) || []; return message; }, }; -function createBaseExportLookupMastersResponse(): ExportLookupMastersResponse { - return { base: undefined, fileContent: new Uint8Array(0), fileName: "" }; +function createBaseTriggerMbBatchRequest(): TriggerMbBatchRequest { + return { period: "" }; } -export const ExportLookupMastersResponse: MessageFns = { - encode(message: ExportLookupMastersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.base !== undefined) { - BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); - } - if (message.fileContent.length !== 0) { - writer.uint32(18).bytes(message.fileContent); - } - if (message.fileName !== "") { - writer.uint32(26).string(message.fileName); +export const TriggerMbBatchRequest: MessageFns = { + encode(message: TriggerMbBatchRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.period !== "") { + writer.uint32(10).string(message.period); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ExportLookupMastersResponse { + decode(input: BinaryReader | Uint8Array, length?: number): TriggerMbBatchRequest { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExportLookupMastersResponse(); + const message = createBaseTriggerMbBatchRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -19032,23 +29049,7 @@ export const ExportLookupMastersResponse: MessageFns): ExportLookupMastersResponse { - return ExportLookupMastersResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): TriggerMbBatchRequest { + return TriggerMbBatchRequest.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ExportLookupMastersResponse { - const message = createBaseExportLookupMastersResponse(); - message.base = (object.base !== undefined && object.base !== null) - ? BaseResponse.fromPartial(object.base) - : undefined; - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; + fromPartial(object: DeepPartial): TriggerMbBatchRequest { + const message = createBaseTriggerMbBatchRequest(); + message.period = object.period ?? ""; return message; }, }; -function createBaseImportLookupMastersRequest(): ImportLookupMastersRequest { - return { fileContent: new Uint8Array(0), fileName: "" }; +function createBaseMbBatchError(): MbBatchError { + return { mbhId: "", error: "" }; } -export const ImportLookupMastersRequest: MessageFns = { - encode(message: ImportLookupMastersRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.fileContent.length !== 0) { - writer.uint32(10).bytes(message.fileContent); +export const MbBatchError: MessageFns = { + encode(message: MbBatchError, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.mbhId !== "") { + writer.uint32(10).string(message.mbhId); } - if (message.fileName !== "") { - writer.uint32(18).string(message.fileName); + if (message.error !== "") { + writer.uint32(18).string(message.error); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportLookupMastersRequest { + decode(input: BinaryReader | Uint8Array, length?: number): MbBatchError { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportLookupMastersRequest(); + const message = createBaseMbBatchError(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -19131,7 +29110,7 @@ export const ImportLookupMastersRequest: MessageFns break; } - message.fileContent = reader.bytes(); + message.mbhId = reader.string(); continue; } case 2: { @@ -19139,7 +29118,7 @@ export const ImportLookupMastersRequest: MessageFns break; } - message.fileName = reader.string(); + message.error = reader.string(); continue; } } @@ -19149,73 +29128,87 @@ export const ImportLookupMastersRequest: MessageFns reader.skip(tag & 7); } return message; - }, - - fromJSON(object: any): ImportLookupMastersRequest { - return { - fileContent: isSet(object.fileContent) - ? bytesFromBase64(object.fileContent) - : isSet(object.file_content) - ? bytesFromBase64(object.file_content) - : new Uint8Array(0), - fileName: isSet(object.fileName) - ? globalThis.String(object.fileName) - : isSet(object.file_name) - ? globalThis.String(object.file_name) + }, + + fromJSON(object: any): MbBatchError { + return { + mbhId: isSet(object.mbhId) + ? globalThis.String(object.mbhId) + : isSet(object.mbh_id) + ? globalThis.String(object.mbh_id) : "", + error: isSet(object.error) ? globalThis.String(object.error) : "", }; }, - toJSON(message: ImportLookupMastersRequest): unknown { + toJSON(message: MbBatchError): unknown { const obj: any = {}; - if (message.fileContent.length !== 0) { - obj.fileContent = base64FromBytes(message.fileContent); + if (message.mbhId !== "") { + obj.mbhId = message.mbhId; } - if (message.fileName !== "") { - obj.fileName = message.fileName; + if (message.error !== "") { + obj.error = message.error; } return obj; }, - create(base?: DeepPartial): ImportLookupMastersRequest { - return ImportLookupMastersRequest.fromPartial(base ?? {}); + create(base?: DeepPartial): MbBatchError { + return MbBatchError.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ImportLookupMastersRequest { - const message = createBaseImportLookupMastersRequest(); - message.fileContent = object.fileContent ?? new Uint8Array(0); - message.fileName = object.fileName ?? ""; + fromPartial(object: DeepPartial): MbBatchError { + const message = createBaseMbBatchError(); + message.mbhId = object.mbhId ?? ""; + message.error = object.error ?? ""; return message; }, }; -function createBaseImportLookupMastersResponse(): ImportLookupMastersResponse { - return { base: undefined, successCount: 0, skippedCount: 0, failedCount: 0, errors: [] }; +function createBaseTriggerMbBatchResponse(): TriggerMbBatchResponse { + return { + base: undefined, + jobId: 0, + period: "", + successCount: 0, + failedCount: 0, + rowsInserted: 0, + durationMs: 0, + errors: [], + }; } -export const ImportLookupMastersResponse: MessageFns = { - encode(message: ImportLookupMastersResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { +export const TriggerMbBatchResponse: MessageFns = { + encode(message: TriggerMbBatchResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { if (message.base !== undefined) { BaseResponse.encode(message.base, writer.uint32(10).fork()).join(); } - if (message.successCount !== 0) { - writer.uint32(16).int32(message.successCount); + if (message.jobId !== 0) { + writer.uint32(16).int64(message.jobId); } - if (message.skippedCount !== 0) { - writer.uint32(24).int32(message.skippedCount); + if (message.period !== "") { + writer.uint32(26).string(message.period); + } + if (message.successCount !== 0) { + writer.uint32(32).int32(message.successCount); } if (message.failedCount !== 0) { - writer.uint32(32).int32(message.failedCount); + writer.uint32(40).int32(message.failedCount); + } + if (message.rowsInserted !== 0) { + writer.uint32(48).int32(message.rowsInserted); + } + if (message.durationMs !== 0) { + writer.uint32(56).int64(message.durationMs); } for (const v of message.errors) { - writer.uint32(42).string(v!); + MbBatchError.encode(v!, writer.uint32(66).fork()).join(); } return writer; }, - decode(input: BinaryReader | Uint8Array, length?: number): ImportLookupMastersResponse { + decode(input: BinaryReader | Uint8Array, length?: number): TriggerMbBatchResponse { const reader = input instanceof BinaryReader ? input : new BinaryReader(input); const end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseImportLookupMastersResponse(); + const message = createBaseTriggerMbBatchResponse(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -19232,15 +29225,15 @@ export const ImportLookupMastersResponse: MessageFns globalThis.String(e)) : [], + rowsInserted: isSet(object.rowsInserted) + ? globalThis.Number(object.rowsInserted) + : isSet(object.rows_inserted) + ? globalThis.Number(object.rows_inserted) + : 0, + durationMs: isSet(object.durationMs) + ? globalThis.Number(object.durationMs) + : isSet(object.duration_ms) + ? globalThis.Number(object.duration_ms) + : 0, + errors: globalThis.Array.isArray(object?.errors) + ? object.errors.map((e: any) => MbBatchError.fromJSON(e)) + : [], }; }, - toJSON(message: ImportLookupMastersResponse): unknown { + toJSON(message: TriggerMbBatchResponse): unknown { const obj: any = {}; if (message.base !== undefined) { obj.base = BaseResponse.toJSON(message.base); } + if (message.jobId !== 0) { + obj.jobId = Math.round(message.jobId); + } + if (message.period !== "") { + obj.period = message.period; + } if (message.successCount !== 0) { obj.successCount = Math.round(message.successCount); } - if (message.skippedCount !== 0) { - obj.skippedCount = Math.round(message.skippedCount); - } if (message.failedCount !== 0) { obj.failedCount = Math.round(message.failedCount); } + if (message.rowsInserted !== 0) { + obj.rowsInserted = Math.round(message.rowsInserted); + } + if (message.durationMs !== 0) { + obj.durationMs = Math.round(message.durationMs); + } if (message.errors?.length) { - obj.errors = message.errors; + obj.errors = message.errors.map((e) => MbBatchError.toJSON(e)); } return obj; }, - create(base?: DeepPartial): ImportLookupMastersResponse { - return ImportLookupMastersResponse.fromPartial(base ?? {}); + create(base?: DeepPartial): TriggerMbBatchResponse { + return TriggerMbBatchResponse.fromPartial(base ?? {}); }, - fromPartial(object: DeepPartial): ImportLookupMastersResponse { - const message = createBaseImportLookupMastersResponse(); + fromPartial(object: DeepPartial): TriggerMbBatchResponse { + const message = createBaseTriggerMbBatchResponse(); message.base = (object.base !== undefined && object.base !== null) ? BaseResponse.fromPartial(object.base) : undefined; + message.jobId = object.jobId ?? 0; + message.period = object.period ?? ""; message.successCount = object.successCount ?? 0; - message.skippedCount = object.skippedCount ?? 0; message.failedCount = object.failedCount ?? 0; - message.errors = object.errors?.map((e) => e) || []; + message.rowsInserted = object.rowsInserted ?? 0; + message.durationMs = object.durationMs ?? 0; + message.errors = object.errors?.map((e) => MbBatchError.fromPartial(e)) || []; return message; }, }; @@ -19746,6 +29788,51 @@ export const MBHeadServiceDefinition = { responseStream: false, options: {}, }, + /** SubmitMBHead submits an MB Head for approval. */ + submitMBHead: { + name: "SubmitMBHead", + requestType: SubmitMBHeadRequest, + requestStream: false, + responseType: SubmitMBHeadResponse, + responseStream: false, + options: {}, + }, + /** ApproveMBHead approves a submitted MB Head. */ + approveMBHead: { + name: "ApproveMBHead", + requestType: ApproveMBHeadRequest, + requestStream: false, + responseType: ApproveMBHeadResponse, + responseStream: false, + options: {}, + }, + /** ValidateMBHead validates an approved MB Head, freezing its cost and param snapshot. */ + validateMBHead: { + name: "ValidateMBHead", + requestType: ValidateMBHeadRequest, + requestStream: false, + responseType: ValidateMBHeadResponse, + responseStream: false, + options: {}, + }, + /** UnApproveMBHead reverts an approved MB Head back to a prior state. */ + unApproveMBHead: { + name: "UnApproveMBHead", + requestType: UnApproveMBHeadRequest, + requestStream: false, + responseType: UnApproveMBHeadResponse, + responseStream: false, + options: {}, + }, + /** RevokeMBHead revokes an MB Head. */ + revokeMBHead: { + name: "RevokeMBHead", + requestType: RevokeMBHeadRequest, + requestStream: false, + responseType: RevokeMBHeadResponse, + responseStream: false, + options: {}, + }, }, } as const; @@ -19960,6 +30047,312 @@ export const YarnLookupFillServiceDefinition = { }, } as const; +/** MbCompositionService manages MB composition lines and their frozen versions. */ +export type MbCompositionServiceDefinition = typeof MbCompositionServiceDefinition; +export const MbCompositionServiceDefinition = { + name: "MbCompositionService", + fullName: "finance.v1.MbCompositionService", + methods: { + /** CreateMbComposition creates a new composition line for an MB Head. */ + createMbComposition: { + name: "CreateMbComposition", + requestType: CreateMbCompositionRequest, + requestStream: false, + responseType: CreateMbCompositionResponse, + responseStream: false, + options: {}, + }, + /** UpdateMbComposition updates an existing composition line. */ + updateMbComposition: { + name: "UpdateMbComposition", + requestType: UpdateMbCompositionRequest, + requestStream: false, + responseType: UpdateMbCompositionResponse, + responseStream: false, + options: {}, + }, + /** DeleteMbComposition deletes a composition line. */ + deleteMbComposition: { + name: "DeleteMbComposition", + requestType: DeleteMbCompositionRequest, + requestStream: false, + responseType: DeleteMbCompositionResponse, + responseStream: false, + options: {}, + }, + /** ListMbCompositions lists composition lines for an MB Head. */ + listMbCompositions: { + name: "ListMbCompositions", + requestType: ListMbCompositionsRequest, + requestStream: false, + responseType: ListMbCompositionsResponse, + responseStream: false, + options: {}, + }, + /** ListMbCompositionVersions lists frozen composition version snapshots for an MB Head. */ + listMbCompositionVersions: { + name: "ListMbCompositionVersions", + requestType: ListMbCompositionVersionsRequest, + requestStream: false, + responseType: ListMbCompositionVersionsResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +/** MbLustureService manages MB lusture master data. */ +export type MbLustureServiceDefinition = typeof MbLustureServiceDefinition; +export const MbLustureServiceDefinition = { + name: "MbLustureService", + fullName: "finance.v1.MbLustureService", + methods: { + /** CreateMbLusture creates a new MB lusture master record. */ + createMbLusture: { + name: "CreateMbLusture", + requestType: CreateMbLustureRequest, + requestStream: false, + responseType: CreateMbLustureResponse, + responseStream: false, + options: {}, + }, + /** UpdateMbLusture updates an existing MB lusture master record. */ + updateMbLusture: { + name: "UpdateMbLusture", + requestType: UpdateMbLustureRequest, + requestStream: false, + responseType: UpdateMbLustureResponse, + responseStream: false, + options: {}, + }, + /** DeleteMbLusture deletes an MB lusture master record. */ + deleteMbLusture: { + name: "DeleteMbLusture", + requestType: DeleteMbLustureRequest, + requestStream: false, + responseType: DeleteMbLustureResponse, + responseStream: false, + options: {}, + }, + /** GetMbLusture retrieves an MB lusture master record by ID. */ + getMbLusture: { + name: "GetMbLusture", + requestType: GetMbLustureRequest, + requestStream: false, + responseType: GetMbLustureResponse, + responseStream: false, + options: {}, + }, + /** ListMbLusture lists MB lusture master records with search and pagination. */ + listMbLusture: { + name: "ListMbLusture", + requestType: ListMbLustureRequest, + requestStream: false, + responseType: ListMbLustureResponse, + responseStream: false, + options: {}, + }, + /** ExportMbLusture exports MB lusture master records to Excel. */ + exportMbLusture: { + name: "ExportMbLusture", + requestType: ExportMbLustureRequest, + requestStream: false, + responseType: ExportMbLustureResponse, + responseStream: false, + options: {}, + }, + /** ImportMbLusture imports MB lusture master records from Excel. */ + importMbLusture: { + name: "ImportMbLusture", + requestType: ImportMbLustureRequest, + requestStream: false, + responseType: ImportMbLustureResponse, + responseStream: false, + options: {}, + }, + /** DownloadMbLustureTemplate downloads the Excel import template. */ + downloadMbLustureTemplate: { + name: "DownloadMbLustureTemplate", + requestType: DownloadMbLustureTemplateRequest, + requestStream: false, + responseType: DownloadMbLustureTemplateResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +/** MbParamService manages MB costing parameter master data and their picklist options. */ +export type MbParamServiceDefinition = typeof MbParamServiceDefinition; +export const MbParamServiceDefinition = { + name: "MbParamService", + fullName: "finance.v1.MbParamService", + methods: { + /** CreateMbParam creates a new MB costing parameter. */ + createMbParam: { + name: "CreateMbParam", + requestType: CreateMbParamRequest, + requestStream: false, + responseType: CreateMbParamResponse, + responseStream: false, + options: {}, + }, + /** UpdateMbParam updates an existing MB costing parameter. */ + updateMbParam: { + name: "UpdateMbParam", + requestType: UpdateMbParamRequest, + requestStream: false, + responseType: UpdateMbParamResponse, + responseStream: false, + options: {}, + }, + /** DeleteMbParam deletes an MB costing parameter. */ + deleteMbParam: { + name: "DeleteMbParam", + requestType: DeleteMbParamRequest, + requestStream: false, + responseType: DeleteMbParamResponse, + responseStream: false, + options: {}, + }, + /** ListMbParams lists MB costing parameters with search and pagination. */ + listMbParams: { + name: "ListMbParams", + requestType: ListMbParamsRequest, + requestStream: false, + responseType: ListMbParamsResponse, + responseStream: false, + options: {}, + }, + /** CreateMbParamOption creates a new picklist option for an MB costing parameter. */ + createMbParamOption: { + name: "CreateMbParamOption", + requestType: CreateMbParamOptionRequest, + requestStream: false, + responseType: CreateMbParamOptionResponse, + responseStream: false, + options: {}, + }, + /** UpdateMbParamOption updates an existing picklist option. */ + updateMbParamOption: { + name: "UpdateMbParamOption", + requestType: UpdateMbParamOptionRequest, + requestStream: false, + responseType: UpdateMbParamOptionResponse, + responseStream: false, + options: {}, + }, + /** DeleteMbParamOption deletes a picklist option. */ + deleteMbParamOption: { + name: "DeleteMbParamOption", + requestType: DeleteMbParamOptionRequest, + requestStream: false, + responseType: DeleteMbParamOptionResponse, + responseStream: false, + options: {}, + }, + /** ExportMbParams exports MB costing parameters to Excel. */ + exportMbParams: { + name: "ExportMbParams", + requestType: ExportMbParamsRequest, + requestStream: false, + responseType: ExportMbParamsResponse, + responseStream: false, + options: {}, + }, + /** ImportMbParams imports MB costing parameters from Excel. */ + importMbParams: { + name: "ImportMbParams", + requestType: ImportMbParamsRequest, + requestStream: false, + responseType: ImportMbParamsResponse, + responseStream: false, + options: {}, + }, + /** DownloadMbParamTemplate downloads the Excel import template. */ + downloadMbParamTemplate: { + name: "DownloadMbParamTemplate", + requestType: DownloadMbParamTemplateRequest, + requestStream: false, + responseType: DownloadMbParamTemplateResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +/** MbPushService previews and executes pushing costed values to MB Heads for a period. */ +export type MbPushServiceDefinition = typeof MbPushServiceDefinition; +export const MbPushServiceDefinition = { + name: "MbPushService", + fullName: "finance.v1.MbPushService", + methods: { + /** PreviewPushToHead previews which MB Heads are pushable/skipped for a period. */ + previewPushToHead: { + name: "PreviewPushToHead", + requestType: PreviewPushToHeadRequest, + requestStream: false, + responseType: PreviewPushToHeadResponse, + responseStream: false, + options: {}, + }, + /** ExecutePushToHead executes the push-to-head batch for the given period and heads. */ + executePushToHead: { + name: "ExecutePushToHead", + requestType: ExecutePushToHeadRequest, + requestStream: false, + responseType: ExecutePushToHeadResponse, + responseStream: false, + options: {}, + }, + /** ListMbPushLogs lists past push-to-head batch executions. */ + listMbPushLogs: { + name: "ListMbPushLogs", + requestType: ListMbPushLogsRequest, + requestStream: false, + responseType: ListMbPushLogsResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +/** MbWorkflowLogService provides read-only access to MB Head workflow transition history. */ +export type MbWorkflowLogServiceDefinition = typeof MbWorkflowLogServiceDefinition; +export const MbWorkflowLogServiceDefinition = { + name: "MbWorkflowLogService", + fullName: "finance.v1.MbWorkflowLogService", + methods: { + /** ListMbWorkflowLogs lists workflow transition log entries for an MB Head. */ + listMbWorkflowLogs: { + name: "ListMbWorkflowLogs", + requestType: ListMbWorkflowLogsRequest, + requestStream: false, + responseType: ListMbWorkflowLogsResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + +/** MbBatchService triggers the MB_BATCH cost calculation orchestration. */ +export type MbBatchServiceDefinition = typeof MbBatchServiceDefinition; +export const MbBatchServiceDefinition = { + name: "MbBatchService", + fullName: "finance.v1.MbBatchService", + methods: { + /** TriggerMbBatch computes cst_product_cost rows for every VALIDATED MB Head for a period. */ + triggerMbBatch: { + name: "TriggerMbBatch", + requestType: TriggerMbBatchRequest, + requestStream: false, + responseType: TriggerMbBatchResponse, + responseStream: false, + options: {}, + }, + }, +} as const; + function bytesFromBase64(b64: string): Uint8Array { if ((globalThis as any).Buffer) { return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); @@ -19993,6 +30386,17 @@ export type DeepPartial = T extends Builtin ? T : T extends {} ? { [K in keyof T]?: DeepPartial } : Partial; +function longToNumber(int64: { toString(): string }): number { + const num = globalThis.Number(int64.toString()); + if (num > globalThis.Number.MAX_SAFE_INTEGER) { + throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + if (num < globalThis.Number.MIN_SAFE_INTEGER) { + throw new globalThis.Error("Value is smaller than Number.MIN_SAFE_INTEGER"); + } + return num; +} + function isObject(value: any): boolean { return typeof value === "object" && value !== null; } From f7f1982543d39f47982219ca3ac9c91518b160b6 Mon Sep 17 00:00:00 2001 From: ilhom Date: Tue, 14 Jul 2026 16:26:07 +0700 Subject: [PATCH 2/2] feat(finance): add MB batch costing UI and BFF Build the Master Batch (MB) costing frontend: - Pages: mb-recipe list + detail (composition/parameters/workflow-log tabs), mb-push-to-head, and mb-lusture / mb-param master pages. - Components: MB recipe tables/tabs/action bar, lusture and param tables with form + import dialogs, push log table + preview panel, MB head ref and RM group-head comboboxes, and the product-master unlock dialog. - BFF API routes for MB head workflow (submit/approve/validate/ unapprove/revoke/import/export/template), compositions, push (preview/execute) + push logs, workflow logs, mb-lusture, mb-param (+ options) and cost-product-master unlock. - TanStack Query hooks and API services for composition, lusture, param, push and workflow-log; MB gRPC clients and status colors. Also extend the cost-product-master parameters tab and detail client, mb-head form dialog, user-name component and menu types to support the MB flow. Authored-By: Ilham R Co-Authored-By: Ilham R Co-Authored-By: Claude Opus 4.8 Co-Authored-By: IT Mutugading Co-Authored-By: IT Mutu Gading --- .../finance/master/mb-lusture/loading.tsx | 13 + .../mb-lusture/mb-lusture-page-client.tsx | 182 +++++++++++ .../finance/master/mb-lusture/page.tsx | 7 + .../finance/master/mb-param/loading.tsx | 13 + .../master/mb-param/mb-param-page-client.tsx | 235 ++++++++++++++ .../finance/master/mb-param/page.tsx | 7 + .../finance/mb-push-to-head/loading.tsx | 13 + .../mb-push-to-head-page-client.tsx | 62 ++++ .../finance/mb-push-to-head/page.tsx | 7 + .../mb-recipe/[mbhId]/detail-client.tsx | 121 +++++++ .../finance/mb-recipe/[mbhId]/loading.tsx | 11 + .../finance/mb-recipe/[mbhId]/page.tsx | 10 + .../(dashboard)/finance/mb-recipe/loading.tsx | 13 + .../mb-recipe/mb-recipe-page-client.tsx | 144 +++++++++ .../(dashboard)/finance/mb-recipe/page.tsx | 7 + .../[productSysId]/detail-client.tsx | 35 +- .../[productSysId]/unlock/route.ts | 19 ++ .../master/mb-lusture/[mblId]/route.ts | 64 ++++ .../finance/master/mb-lusture/export/route.ts | 41 +++ .../finance/master/mb-lusture/import/route.ts | 47 +++ .../api/v1/finance/master/mb-lusture/route.ts | 76 +++++ .../master/mb-lusture/template/route.ts | 35 ++ .../[mbpId]/options/[mbpoId]/route.ts | 64 ++++ .../master/mb-param/[mbpId]/options/route.ts | 33 ++ .../finance/master/mb-param/[mbpId]/route.ts | 64 ++++ .../finance/master/mb-param/export/route.ts | 41 +++ .../finance/master/mb-param/import/route.ts | 47 +++ .../api/v1/finance/master/mb-param/route.ts | 76 +++++ .../finance/master/mb-param/template/route.ts | 35 ++ .../finance/mb-compositions/[mbcmId]/route.ts | 64 ++++ .../api/v1/finance/mb-compositions/route.ts | 64 ++++ .../finance/mb-compositions/versions/route.ts | 36 +++ .../finance/mb-heads/[mbhId]/approve/route.ts | 35 ++ .../finance/mb-heads/[mbhId]/revoke/route.ts | 36 +++ .../finance/mb-heads/[mbhId]/submit/route.ts | 35 ++ .../mb-heads/[mbhId]/unapprove/route.ts | 36 +++ .../mb-heads/[mbhId]/validate/route.ts | 35 ++ .../api/v1/finance/mb-heads/export/route.ts | 43 +++ .../api/v1/finance/mb-heads/import/route.ts | 47 +++ .../api/v1/finance/mb-heads/template/route.ts | 35 ++ src/app/api/v1/finance/mb-push-logs/route.ts | 44 +++ .../api/v1/finance/mb-push/execute/route.ts | 36 +++ .../api/v1/finance/mb-push/preview/route.ts | 33 ++ .../api/v1/finance/mb-workflow-logs/route.ts | 35 ++ src/components/common/user-name.tsx | 15 +- .../comboboxes/mb-head-ref-combobox.tsx | 91 ++++++ .../comboboxes/rm-group-head-combobox.tsx | 88 +++++ .../add-parameter-dialog.tsx | 5 +- .../finance/cost-product-master/index.ts | 1 + .../master-lookup-field.tsx | 4 +- .../cost-product-master/parameters-tab.tsx | 99 +++++- .../cost-product-master/unlock-dialog.tsx | 79 +++++ .../finance/mb-head/mb-head-form-dialog.tsx | 152 ++++++++- src/components/finance/mb-lusture/index.ts | 8 + .../mb-lusture/mb-lusture-form-dialog.tsx | 209 ++++++++++++ .../mb-lusture/mb-lusture-import-dialog.tsx | 287 +++++++++++++++++ .../finance/mb-lusture/mb-lusture-table.tsx | 114 +++++++ src/components/finance/mb-param/index.ts | 9 + .../finance/mb-param/mb-param-form-dialog.tsx | 292 +++++++++++++++++ .../mb-param/mb-param-import-dialog.tsx | 287 +++++++++++++++++ .../mb-param/mb-param-option-form-dialog.tsx | 203 ++++++++++++ .../finance/mb-param/mb-param-table.tsx | 300 ++++++++++++++++++ src/components/finance/mb-push/index.ts | 2 + .../finance/mb-push/mb-push-log-table.tsx | 81 +++++ .../finance/mb-push/mb-push-preview-panel.tsx | 143 +++++++++ src/components/finance/mb-recipe/index.ts | 5 + .../mb-recipe/mb-composition-line-dialog.tsx | 149 +++++++++ .../finance/mb-recipe/mb-composition-tab.tsx | 201 ++++++++++++ .../finance/mb-recipe/mb-parameters-tab.tsx | 75 +++++ .../mb-recipe/mb-recipe-action-bar.tsx | 105 ++++++ .../finance/mb-recipe/mb-recipe-table.tsx | 159 ++++++++++ .../finance/mb-recipe/mb-workflow-log-tab.tsx | 60 ++++ src/hooks/finance/use-cost-product-master.ts | 21 ++ src/hooks/finance/use-mb-composition.ts | 90 ++++++ src/hooks/finance/use-mb-head.ts | 70 ++++ src/hooks/finance/use-mb-lusture.ts | 159 ++++++++++ src/hooks/finance/use-mb-param.ts | 215 +++++++++++++ src/hooks/finance/use-mb-push.ts | 55 ++++ src/hooks/finance/use-mb-workflow-log.ts | 17 + src/lib/grpc/clients.ts | 37 +++ src/lib/grpc/index.ts | 5 + src/lib/ui/status-colors.ts | 10 +- src/services/finance/mb-composition-api.ts | 81 +++++ src/services/finance/mb-head-api.ts | 42 +++ src/services/finance/mb-lusture-api.ts | 80 +++++ src/services/finance/mb-param-api.ts | 134 ++++++++ src/services/finance/mb-push-api.ts | 77 +++++ src/services/finance/mb-workflow-log-api.ts | 18 ++ src/types/finance/cost-product-master.ts | 4 + src/types/finance/mb-composition.ts | 84 +++++ src/types/finance/mb-head.ts | 69 +++- src/types/finance/mb-lusture.ts | 97 ++++++ src/types/finance/mb-param.ts | 138 ++++++++ src/types/finance/mb-push-log.ts | 51 +++ src/types/finance/mb-workflow-log.ts | 31 ++ src/types/iam/menu.ts | 5 + 96 files changed, 6914 insertions(+), 35 deletions(-) create mode 100644 src/app/(dashboard)/finance/master/mb-lusture/loading.tsx create mode 100644 src/app/(dashboard)/finance/master/mb-lusture/mb-lusture-page-client.tsx create mode 100644 src/app/(dashboard)/finance/master/mb-lusture/page.tsx create mode 100644 src/app/(dashboard)/finance/master/mb-param/loading.tsx create mode 100644 src/app/(dashboard)/finance/master/mb-param/mb-param-page-client.tsx create mode 100644 src/app/(dashboard)/finance/master/mb-param/page.tsx create mode 100644 src/app/(dashboard)/finance/mb-push-to-head/loading.tsx create mode 100644 src/app/(dashboard)/finance/mb-push-to-head/mb-push-to-head-page-client.tsx create mode 100644 src/app/(dashboard)/finance/mb-push-to-head/page.tsx create mode 100644 src/app/(dashboard)/finance/mb-recipe/[mbhId]/detail-client.tsx create mode 100644 src/app/(dashboard)/finance/mb-recipe/[mbhId]/loading.tsx create mode 100644 src/app/(dashboard)/finance/mb-recipe/[mbhId]/page.tsx create mode 100644 src/app/(dashboard)/finance/mb-recipe/loading.tsx create mode 100644 src/app/(dashboard)/finance/mb-recipe/mb-recipe-page-client.tsx create mode 100644 src/app/(dashboard)/finance/mb-recipe/page.tsx create mode 100644 src/app/api/v1/finance/cost-product-masters/[productSysId]/unlock/route.ts create mode 100644 src/app/api/v1/finance/master/mb-lusture/[mblId]/route.ts create mode 100644 src/app/api/v1/finance/master/mb-lusture/export/route.ts create mode 100644 src/app/api/v1/finance/master/mb-lusture/import/route.ts create mode 100644 src/app/api/v1/finance/master/mb-lusture/route.ts create mode 100644 src/app/api/v1/finance/master/mb-lusture/template/route.ts create mode 100644 src/app/api/v1/finance/master/mb-param/[mbpId]/options/[mbpoId]/route.ts create mode 100644 src/app/api/v1/finance/master/mb-param/[mbpId]/options/route.ts create mode 100644 src/app/api/v1/finance/master/mb-param/[mbpId]/route.ts create mode 100644 src/app/api/v1/finance/master/mb-param/export/route.ts create mode 100644 src/app/api/v1/finance/master/mb-param/import/route.ts create mode 100644 src/app/api/v1/finance/master/mb-param/route.ts create mode 100644 src/app/api/v1/finance/master/mb-param/template/route.ts create mode 100644 src/app/api/v1/finance/mb-compositions/[mbcmId]/route.ts create mode 100644 src/app/api/v1/finance/mb-compositions/route.ts create mode 100644 src/app/api/v1/finance/mb-compositions/versions/route.ts create mode 100644 src/app/api/v1/finance/mb-heads/[mbhId]/approve/route.ts create mode 100644 src/app/api/v1/finance/mb-heads/[mbhId]/revoke/route.ts create mode 100644 src/app/api/v1/finance/mb-heads/[mbhId]/submit/route.ts create mode 100644 src/app/api/v1/finance/mb-heads/[mbhId]/unapprove/route.ts create mode 100644 src/app/api/v1/finance/mb-heads/[mbhId]/validate/route.ts create mode 100644 src/app/api/v1/finance/mb-heads/export/route.ts create mode 100644 src/app/api/v1/finance/mb-heads/import/route.ts create mode 100644 src/app/api/v1/finance/mb-heads/template/route.ts create mode 100644 src/app/api/v1/finance/mb-push-logs/route.ts create mode 100644 src/app/api/v1/finance/mb-push/execute/route.ts create mode 100644 src/app/api/v1/finance/mb-push/preview/route.ts create mode 100644 src/app/api/v1/finance/mb-workflow-logs/route.ts create mode 100644 src/components/finance/comboboxes/mb-head-ref-combobox.tsx create mode 100644 src/components/finance/comboboxes/rm-group-head-combobox.tsx create mode 100644 src/components/finance/cost-product-master/unlock-dialog.tsx create mode 100644 src/components/finance/mb-lusture/index.ts create mode 100644 src/components/finance/mb-lusture/mb-lusture-form-dialog.tsx create mode 100644 src/components/finance/mb-lusture/mb-lusture-import-dialog.tsx create mode 100644 src/components/finance/mb-lusture/mb-lusture-table.tsx create mode 100644 src/components/finance/mb-param/index.ts create mode 100644 src/components/finance/mb-param/mb-param-form-dialog.tsx create mode 100644 src/components/finance/mb-param/mb-param-import-dialog.tsx create mode 100644 src/components/finance/mb-param/mb-param-option-form-dialog.tsx create mode 100644 src/components/finance/mb-param/mb-param-table.tsx create mode 100644 src/components/finance/mb-push/index.ts create mode 100644 src/components/finance/mb-push/mb-push-log-table.tsx create mode 100644 src/components/finance/mb-push/mb-push-preview-panel.tsx create mode 100644 src/components/finance/mb-recipe/index.ts create mode 100644 src/components/finance/mb-recipe/mb-composition-line-dialog.tsx create mode 100644 src/components/finance/mb-recipe/mb-composition-tab.tsx create mode 100644 src/components/finance/mb-recipe/mb-parameters-tab.tsx create mode 100644 src/components/finance/mb-recipe/mb-recipe-action-bar.tsx create mode 100644 src/components/finance/mb-recipe/mb-recipe-table.tsx create mode 100644 src/components/finance/mb-recipe/mb-workflow-log-tab.tsx create mode 100644 src/hooks/finance/use-mb-composition.ts create mode 100644 src/hooks/finance/use-mb-lusture.ts create mode 100644 src/hooks/finance/use-mb-param.ts create mode 100644 src/hooks/finance/use-mb-push.ts create mode 100644 src/hooks/finance/use-mb-workflow-log.ts create mode 100644 src/services/finance/mb-composition-api.ts create mode 100644 src/services/finance/mb-head-api.ts create mode 100644 src/services/finance/mb-lusture-api.ts create mode 100644 src/services/finance/mb-param-api.ts create mode 100644 src/services/finance/mb-push-api.ts create mode 100644 src/services/finance/mb-workflow-log-api.ts create mode 100644 src/types/finance/mb-composition.ts create mode 100644 src/types/finance/mb-lusture.ts create mode 100644 src/types/finance/mb-param.ts create mode 100644 src/types/finance/mb-push-log.ts create mode 100644 src/types/finance/mb-workflow-log.ts diff --git a/src/app/(dashboard)/finance/master/mb-lusture/loading.tsx b/src/app/(dashboard)/finance/master/mb-lusture/loading.tsx new file mode 100644 index 0000000..7f17732 --- /dev/null +++ b/src/app/(dashboard)/finance/master/mb-lusture/loading.tsx @@ -0,0 +1,13 @@ +import { TableSkeleton } from "@/components/loading" + +export default function MbLustureLoading() { + return ( +
+
+
+
+
+ +
+ ) +} diff --git a/src/app/(dashboard)/finance/master/mb-lusture/mb-lusture-page-client.tsx b/src/app/(dashboard)/finance/master/mb-lusture/mb-lusture-page-client.tsx new file mode 100644 index 0000000..0aa489a --- /dev/null +++ b/src/app/(dashboard)/finance/master/mb-lusture/mb-lusture-page-client.tsx @@ -0,0 +1,182 @@ +"use client" + +import { Plus, Download, Upload, Loader2 } from "lucide-react" +import { useState } from "react" + +import { PageHeader } from "@/components/common/page-header" +import { DebouncedSearchInput } from "@/components/common/debounced-search-input" +import { Button } from "@/components/ui/button" +import { + Select, SelectContent, SelectItem, SelectTrigger, SelectValue, +} from "@/components/ui/select" +import { Card, CardContent } from "@/components/ui/card" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu" +import { ColumnVisibilityMenu, DataTablePagination } from "@/components/shared" +import { ConfirmDialog } from "@/components/shared/confirm-dialog/confirm-dialog" +import { + MbLustureFormDialog, + MbLustureImportDialog, + MbLustureTable, + useMbLustureTableColumns, +} from "@/components/finance/mb-lusture" +import { useMbLustures, useDeleteMbLusture, useExportMbLustures } from "@/hooks/finance/use-mb-lusture" +import { useUrlState } from "@/lib/hooks" +import { ActiveFilter, ACTIVE_FILTER_OPTIONS, type ListMbLustureParams, type MbLusture } from "@/types/finance/mb-lusture" + +const defaultFilters: ListMbLustureParams = { + search: "", + activeFilter: ActiveFilter.ACTIVE_FILTER_ACTIVE, + sortBy: "", + sortDir: "", + page: 1, + pageSize: 20, +} + +export default function MbLusturePageClient() { + const [filters, setFilters] = useUrlState({ defaultValues: defaultFilters }) + const [formOpen, setFormOpen] = useState(false) + const [editing, setEditing] = useState(null) + const [deleteTarget, setDeleteTarget] = useState(null) + const [importOpen, setImportOpen] = useState(false) + + const { data, isLoading } = useMbLustures(filters) + const { columns, visibility, toggle, setAll, reset } = useMbLustureTableColumns() + const deleteMutation = useDeleteMbLusture() + const exportMutation = useExportMbLustures() + const items = data?.items ?? [] + const totalItems = Number(data?.totalItems ?? 0) + + function handleSort(sortKey: string) { + const nextDir = filters.sortBy === sortKey && filters.sortDir === "asc" ? "desc" : "asc" + setFilters({ ...filters, sortBy: sortKey, sortDir: nextDir, page: 1 }) + } + + function openCreate() { + setEditing(null) + setFormOpen(true) + } + function openEdit(l: MbLusture) { + setEditing(l) + setFormOpen(true) + } + + return ( +
+ +
+ + + + + + exportMutation.mutate({ activeFilter: filters.activeFilter })} + disabled={exportMutation.isPending} + > + + Export to Excel + + setImportOpen(true)}> + + Import from Excel + + + + + +
+
+ + + +
+ setFilters({ ...filters, search, page: 1 })} + placeholder="Search by code or name…" + containerClassName="min-w-0" + className="h-9" + /> + +
+ +
+
+ + + + {totalItems > 0 && ( + setFilters({ ...filters, page })} + onPageSizeChange={(pageSize) => setFilters({ ...filters, pageSize, page: 1 })} + /> + )} +
+
+ + + + + !open && setDeleteTarget(null)} + title="Delete MB Lusture" + description={`"${deleteTarget?.displayName}" will be permanently deleted.`} + variant="destructive" + confirmText="Delete" + isLoading={deleteMutation.isPending} + onConfirm={() => { + if (deleteTarget) { + deleteMutation.mutate(deleteTarget.mblId, { onSuccess: () => setDeleteTarget(null) }) + } + }} + /> +
+ ) +} diff --git a/src/app/(dashboard)/finance/master/mb-lusture/page.tsx b/src/app/(dashboard)/finance/master/mb-lusture/page.tsx new file mode 100644 index 0000000..d7b573d --- /dev/null +++ b/src/app/(dashboard)/finance/master/mb-lusture/page.tsx @@ -0,0 +1,7 @@ +import { generateMetadata as genMeta } from "@/config/site" +import MbLusturePageClient from "./mb-lusture-page-client" + +export const metadata = genMeta("MB Lusture") +export default function MbLusturePage() { + return +} diff --git a/src/app/(dashboard)/finance/master/mb-param/loading.tsx b/src/app/(dashboard)/finance/master/mb-param/loading.tsx new file mode 100644 index 0000000..750eb4d --- /dev/null +++ b/src/app/(dashboard)/finance/master/mb-param/loading.tsx @@ -0,0 +1,13 @@ +import { TableSkeleton } from "@/components/loading" + +export default function MbParamLoading() { + return ( +
+
+
+
+
+ +
+ ) +} diff --git a/src/app/(dashboard)/finance/master/mb-param/mb-param-page-client.tsx b/src/app/(dashboard)/finance/master/mb-param/mb-param-page-client.tsx new file mode 100644 index 0000000..d0fcf0b --- /dev/null +++ b/src/app/(dashboard)/finance/master/mb-param/mb-param-page-client.tsx @@ -0,0 +1,235 @@ +"use client" + +import { Plus, Download, Upload, Loader2 } from "lucide-react" +import { useState } from "react" + +import { PageHeader } from "@/components/common/page-header" +import { DebouncedSearchInput } from "@/components/common/debounced-search-input" +import { Button } from "@/components/ui/button" +import { + Select, SelectContent, SelectItem, SelectTrigger, SelectValue, +} from "@/components/ui/select" +import { Card, CardContent } from "@/components/ui/card" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu" +import { ColumnVisibilityMenu, DataTablePagination } from "@/components/shared" +import { ConfirmDialog } from "@/components/shared/confirm-dialog/confirm-dialog" +import { + MbParamFormDialog, + MbParamOptionFormDialog, + MbParamImportDialog, + MbParamTable, + useMbParamTableColumns, +} from "@/components/finance/mb-param" +import { + useMbParams, + useDeleteMbParam, + useDeleteMbParamOption, + useExportMbParams, +} from "@/hooks/finance/use-mb-param" +import { useUrlState } from "@/lib/hooks" +import { ActiveFilter, ACTIVE_FILTER_OPTIONS, type ListMbParamsParams, type MbParam, type MbParamOption } from "@/types/finance/mb-param" + +const defaultFilters: ListMbParamsParams = { + search: "", + activeFilter: ActiveFilter.ACTIVE_FILTER_ACTIVE, + sortBy: "", + sortDir: "", + page: 1, + pageSize: 20, +} + +export default function MbParamPageClient() { + const [filters, setFilters] = useUrlState({ defaultValues: defaultFilters }) + const [formOpen, setFormOpen] = useState(false) + const [editing, setEditing] = useState(null) + const [deleteTarget, setDeleteTarget] = useState(null) + + const [optionFormOpen, setOptionFormOpen] = useState(false) + const [optionParam, setOptionParam] = useState(null) + const [editingOption, setEditingOption] = useState(null) + const [deleteOptionTarget, setDeleteOptionTarget] = useState<{ param: MbParam; option: MbParamOption } | null>(null) + const [importOpen, setImportOpen] = useState(false) + + const { data, isLoading } = useMbParams(filters) + const { columns, visibility, toggle, setAll, reset } = useMbParamTableColumns() + const deleteMutation = useDeleteMbParam() + const deleteOptionMutation = useDeleteMbParamOption() + const exportMutation = useExportMbParams() + const items = data?.items ?? [] + const totalItems = Number(data?.totalItems ?? 0) + + function handleSort(sortKey: string) { + const nextDir = filters.sortBy === sortKey && filters.sortDir === "asc" ? "desc" : "asc" + setFilters({ ...filters, sortBy: sortKey, sortDir: nextDir, page: 1 }) + } + + function openCreate() { + setEditing(null) + setFormOpen(true) + } + function openEdit(p: MbParam) { + setEditing(p) + setFormOpen(true) + } + function openAddOption(param: MbParam) { + setOptionParam(param) + setEditingOption(null) + setOptionFormOpen(true) + } + function openEditOption(param: MbParam, option: MbParamOption) { + setOptionParam(param) + setEditingOption(option) + setOptionFormOpen(true) + } + + return ( +
+ +
+ + + + + + exportMutation.mutate({ activeFilter: filters.activeFilter })} + disabled={exportMutation.isPending} + > + + Export to Excel + + setImportOpen(true)}> + + Import from Excel + + + + + +
+
+ + + +
+ setFilters({ ...filters, search, page: 1 })} + placeholder="Search by code or name…" + containerClassName="min-w-0" + className="h-9" + /> + +
+ +
+
+ + setDeleteOptionTarget({ param, option })} + sortBy={filters.sortBy} + sortOrder={filters.sortDir as "asc" | "desc" | undefined} + onSort={handleSort} + visibility={visibility} + /> + + {totalItems > 0 && ( + setFilters({ ...filters, page })} + onPageSizeChange={(pageSize) => setFilters({ ...filters, pageSize, page: 1 })} + /> + )} +
+
+ + + + + {optionParam && ( + + )} + + !open && setDeleteTarget(null)} + title="Delete Parameter" + description={`"${deleteTarget?.name}" will be permanently deleted.`} + variant="destructive" + confirmText="Delete" + isLoading={deleteMutation.isPending} + onConfirm={() => { + if (deleteTarget) { + deleteMutation.mutate(deleteTarget.mbpId, { onSuccess: () => setDeleteTarget(null) }) + } + }} + /> + + !open && setDeleteOptionTarget(null)} + title="Delete Option" + description={`"${deleteOptionTarget?.option.code}" will be permanently deleted.`} + variant="destructive" + confirmText="Delete" + isLoading={deleteOptionMutation.isPending} + onConfirm={() => { + if (deleteOptionTarget) { + deleteOptionMutation.mutate( + { mbpId: deleteOptionTarget.param.mbpId, mbpoId: deleteOptionTarget.option.mbpoId }, + { onSuccess: () => setDeleteOptionTarget(null) } + ) + } + }} + /> +
+ ) +} diff --git a/src/app/(dashboard)/finance/master/mb-param/page.tsx b/src/app/(dashboard)/finance/master/mb-param/page.tsx new file mode 100644 index 0000000..ba97b59 --- /dev/null +++ b/src/app/(dashboard)/finance/master/mb-param/page.tsx @@ -0,0 +1,7 @@ +import { generateMetadata as genMeta } from "@/config/site" +import MbParamPageClient from "./mb-param-page-client" + +export const metadata = genMeta("MB Param") +export default function MbParamPage() { + return +} diff --git a/src/app/(dashboard)/finance/mb-push-to-head/loading.tsx b/src/app/(dashboard)/finance/mb-push-to-head/loading.tsx new file mode 100644 index 0000000..9464a7e --- /dev/null +++ b/src/app/(dashboard)/finance/mb-push-to-head/loading.tsx @@ -0,0 +1,13 @@ +import { TableSkeleton } from "@/components/loading" + +export default function MbPushToHeadLoading() { + return ( +
+
+
+
+
+ +
+ ) +} diff --git a/src/app/(dashboard)/finance/mb-push-to-head/mb-push-to-head-page-client.tsx b/src/app/(dashboard)/finance/mb-push-to-head/mb-push-to-head-page-client.tsx new file mode 100644 index 0000000..d4c6fc2 --- /dev/null +++ b/src/app/(dashboard)/finance/mb-push-to-head/mb-push-to-head-page-client.tsx @@ -0,0 +1,62 @@ +"use client" + +import { useState } from "react" + +import { PageHeader } from "@/components/common/page-header" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { Input } from "@/components/ui/input" +import { Label } from "@/components/ui/label" +import { MbPushPreviewPanel, MbPushLogTable } from "@/components/finance/mb-push" +import { useMbPushLogs } from "@/hooks/finance/use-mb-push" + +function currentPeriod(): string { + const now = new Date() + const y = now.getFullYear() + const m = String(now.getMonth() + 1).padStart(2, "0") + return `${y}${m}` +} + +export default function MbPushToHeadPageClient() { + const [period, setPeriod] = useState(currentPeriod()) + const { data: logData, isLoading: logsLoading } = useMbPushLogs({ page: 1, pageSize: 20 }) + + return ( +
+ + + + + Period + + +
+ + setPeriod(e.target.value.replace(/[^0-9]/g, "").slice(0, 6))} + placeholder="e.g., 202601" + maxLength={6} + className="font-mono" + /> +
+ + {period.length === 6 ? ( + + ) : ( +

Enter a 6-digit period to preview pushable MB Heads.

+ )} +
+
+ + + + Push History + + + + + +
+ ) +} diff --git a/src/app/(dashboard)/finance/mb-push-to-head/page.tsx b/src/app/(dashboard)/finance/mb-push-to-head/page.tsx new file mode 100644 index 0000000..c3ec82f --- /dev/null +++ b/src/app/(dashboard)/finance/mb-push-to-head/page.tsx @@ -0,0 +1,7 @@ +import { generateMetadata as genMeta } from "@/config/site" +import MbPushToHeadPageClient from "./mb-push-to-head-page-client" + +export const metadata = genMeta("MB Push to Head") +export default function MbPushToHeadPage() { + return +} diff --git a/src/app/(dashboard)/finance/mb-recipe/[mbhId]/detail-client.tsx b/src/app/(dashboard)/finance/mb-recipe/[mbhId]/detail-client.tsx new file mode 100644 index 0000000..66db2ba --- /dev/null +++ b/src/app/(dashboard)/finance/mb-recipe/[mbhId]/detail-client.tsx @@ -0,0 +1,121 @@ +"use client" + +import Link from "next/link" +import { ArrowLeft, Beaker } from "lucide-react" + +import { Button } from "@/components/ui/button" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { PageHeader } from "@/components/common/page-header" +import { StatusBadge } from "@/components/common/status-badge" +import { useBreadcrumbOverride } from "@/components/common/dynamic-breadcrumb" +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" +import { EmptyState } from "@/components/common/empty-state" +import { useMBHead } from "@/hooks/finance/use-mb-head" +import { + MbCompositionTab, + MbParametersTab, + MbWorkflowLogTab, + MbRecipeActionBar, +} from "@/components/finance/mb-recipe" + +interface Props { + mbhId: string +} + +export default function MbRecipeDetailClient({ mbhId }: Props) { + const { data, isLoading } = useMBHead(mbhId) + const mbHead = data?.data + + useBreadcrumbOverride(mbHead ? mbHead.devCode || mbHead.mbhMbCosting || null : null) + + if (isLoading) { + return ( +
+ +
+ ) + } + + if (!mbHead) { + return ( +
+ + +
+ ) + } + + return ( +
+ + +
+ + +
+ + + + + + Identity + + + + + + + + + + + + {mbHead.stateReason && ( +
+ +
+ )} +
+
+ + + + Composition + Parameters + Workflow log + + + + + + + + + + + +
+ ) +} + +function Field({ label, value, mono }: { label: string; value: string; mono?: boolean }) { + return ( +
+
{label}
+
{value}
+
+ ) +} diff --git a/src/app/(dashboard)/finance/mb-recipe/[mbhId]/loading.tsx b/src/app/(dashboard)/finance/mb-recipe/[mbhId]/loading.tsx new file mode 100644 index 0000000..e1ed53e --- /dev/null +++ b/src/app/(dashboard)/finance/mb-recipe/[mbhId]/loading.tsx @@ -0,0 +1,11 @@ +import { Skeleton } from "@/components/ui/skeleton" + +export default function Loading() { + return ( +
+ + + +
+ ) +} diff --git a/src/app/(dashboard)/finance/mb-recipe/[mbhId]/page.tsx b/src/app/(dashboard)/finance/mb-recipe/[mbhId]/page.tsx new file mode 100644 index 0000000..d572e3a --- /dev/null +++ b/src/app/(dashboard)/finance/mb-recipe/[mbhId]/page.tsx @@ -0,0 +1,10 @@ +import MbRecipeDetailClient from "./detail-client" + +export default async function MbRecipeDetailPage({ + params, +}: { + params: Promise<{ mbhId: string }> +}) { + const { mbhId } = await params + return +} diff --git a/src/app/(dashboard)/finance/mb-recipe/loading.tsx b/src/app/(dashboard)/finance/mb-recipe/loading.tsx new file mode 100644 index 0000000..6b58ea3 --- /dev/null +++ b/src/app/(dashboard)/finance/mb-recipe/loading.tsx @@ -0,0 +1,13 @@ +import { TableSkeleton } from "@/components/loading" + +export default function MbRecipeLoading() { + return ( +
+
+
+
+
+ +
+ ) +} diff --git a/src/app/(dashboard)/finance/mb-recipe/mb-recipe-page-client.tsx b/src/app/(dashboard)/finance/mb-recipe/mb-recipe-page-client.tsx new file mode 100644 index 0000000..9c691d9 --- /dev/null +++ b/src/app/(dashboard)/finance/mb-recipe/mb-recipe-page-client.tsx @@ -0,0 +1,144 @@ +"use client" + +import { useState } from "react" +import { Plus, Download, Upload, Loader2 } from "lucide-react" + +import { PageHeader } from "@/components/common/page-header" +import { DebouncedSearchInput } from "@/components/common/debounced-search-input" +import { Button } from "@/components/ui/button" +import { + Select, SelectContent, SelectItem, SelectTrigger, SelectValue, +} from "@/components/ui/select" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu" +import { MbRecipeTable, useMbRecipeTableColumns } from "@/components/finance/mb-recipe" +import { MBHeadFormDialog, MBHeadImportDialog } from "@/components/finance/mb-head" +import { ColumnVisibilityMenu, DataTablePagination } from "@/components/shared" +import { useMBHeads, useExportMBHeads } from "@/hooks/finance/use-mb-head" +import { useUrlState } from "@/lib/hooks" +import { ActiveFilter, ACTIVE_FILTER_OPTIONS, type ListMBHeadsParams } from "@/types/finance/mb-head" + +const defaultFilters: ListMBHeadsParams = { + search: "", + activeFilter: ActiveFilter.ACTIVE_FILTER_ACTIVE, + sortBy: "", + sortOrder: "", + page: 1, + pageSize: 20, +} + +export default function MbRecipePageClient() { + const [filters, setFilters] = useUrlState({ defaultValues: defaultFilters }) + const { data, isLoading } = useMBHeads(filters) + const { columns, visibility, toggle, setAll, reset } = useMbRecipeTableColumns() + const [createOpen, setCreateOpen] = useState(false) + const [importOpen, setImportOpen] = useState(false) + const exportMutation = useExportMBHeads() + + function handleSort(sortKey: string) { + const nextOrder = filters.sortBy === sortKey && filters.sortOrder === "asc" ? "desc" : "asc" + setFilters({ ...filters, sortBy: sortKey, sortOrder: nextOrder, page: 1 }) + } + + const items = data?.data ?? [] + const pagination = data?.pagination + const totalItems = Number(pagination?.totalItems ?? 0) + + return ( +
+ +
+ + + + + + exportMutation.mutate({ activeFilter: filters.activeFilter })} + disabled={exportMutation.isPending} + > + + Export to Excel + + setImportOpen(true)}> + + Import from Excel + + + + + +
+
+ +
+ setFilters({ ...filters, search, page: 1 })} + placeholder="Search by dev code, shade code, or shade name…" + containerClassName="min-w-0" + className="h-9" + /> + +
+ +
+
+ + + + {totalItems > 0 && ( + setFilters({ ...filters, page })} + onPageSizeChange={(pageSize) => setFilters({ ...filters, pageSize, page: 1 })} + /> + )} + + + +
+ ) +} diff --git a/src/app/(dashboard)/finance/mb-recipe/page.tsx b/src/app/(dashboard)/finance/mb-recipe/page.tsx new file mode 100644 index 0000000..e63b588 --- /dev/null +++ b/src/app/(dashboard)/finance/mb-recipe/page.tsx @@ -0,0 +1,7 @@ +import { generateMetadata as genMeta } from "@/config/site" +import MbRecipePageClient from "./mb-recipe-page-client" + +export const metadata = genMeta("MB Recipe") +export default function MbRecipePage() { + return +} diff --git a/src/app/(dashboard)/finance/product-master/[productSysId]/detail-client.tsx b/src/app/(dashboard)/finance/product-master/[productSysId]/detail-client.tsx index 236e090..d931d0d 100644 --- a/src/app/(dashboard)/finance/product-master/[productSysId]/detail-client.tsx +++ b/src/app/(dashboard)/finance/product-master/[productSysId]/detail-client.tsx @@ -2,22 +2,25 @@ import Link from "next/link" import { useState } from "react" -import { ArrowLeft, Download, Loader2, Package } from "lucide-react" +import { ArrowLeft, Download, Loader2, Lock, Package } from "lucide-react" import { useRouter } from "next/navigation" import { toast } from "sonner" +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { PageHeader } from "@/components/common/page-header" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { useCostProductMaster } from "@/hooks/finance/use-cost-product-master" +import { usePermissionContext } from "@/providers/permission-provider" import { CalculateButton } from "@/components/finance/calc-jobs/calculate-button" import { ProductParametersTab } from "@/components/finance/cost-product-master/parameters-tab" import { ProductRoutingTab } from "@/components/finance/cost-product-master/routing-tab" import { ProductAuditTab } from "@/components/finance/cost-product-master/audit-tab" import { CostHistoryTab } from "@/components/finance/cost-results/cost-history-tab" import { ProductTypeName } from "@/components/common/product-type-name" +import { UnlockProductMasterDialog } from "@/components/finance/cost-product-master/unlock-dialog" import { exportBulkProductRouting } from "@/services/finance/cost-import-api" interface Props { @@ -28,6 +31,9 @@ export default function ProductMasterDetailClient({ productSysId }: Props) { const { data: product, isLoading } = useCostProductMaster(productSysId) const router = useRouter() const [exporting, setExporting] = useState(false) + const [unlockOpen, setUnlockOpen] = useState(false) + const { hasPermission } = usePermissionContext() + const canUnlock = hasPermission("finance.product.route.update") async function handleExport() { setExporting(true) @@ -86,6 +92,24 @@ export default function ProductMasterDetailClient({ productSysId }: Props) {
+ {product && product.isLocked && ( + + + Product locked + + + Route and parameters are locked while an MB recipe is linked. Unlock temporarily to make manual + edits. + + {canUnlock && ( + + )} + + + )} + {product && ( @@ -93,6 +117,11 @@ export default function ProductMasterDetailClient({ productSysId }: Props) { Identity {!product.isActive && Inactive} + {product.isLocked && ( + + Locked + + )} @@ -130,7 +159,7 @@ export default function ProductMasterDetailClient({ productSysId }: Props) { Audit - + @@ -142,6 +171,8 @@ export default function ProductMasterDetailClient({ productSysId }: Props) { + +
) } diff --git a/src/app/api/v1/finance/cost-product-masters/[productSysId]/unlock/route.ts b/src/app/api/v1/finance/cost-product-masters/[productSysId]/unlock/route.ts new file mode 100644 index 0000000..ec5b378 --- /dev/null +++ b/src/app/api/v1/finance/cost-product-masters/[productSysId]/unlock/route.ts @@ -0,0 +1,19 @@ +import { NextRequest, NextResponse } from "next/server" +import { getCostProductMasterClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +export async function POST(request: NextRequest, { params }: { params: Promise<{ productSysId: string }> }) { + try { + const { productSysId } = await params + const body = await request.json().catch(() => ({})) + const metadata = createMetadataFromRequest(request) + const client = getCostProductMasterClient() + const response = await client.unlockCostProductMaster( + { productSysId: Number(productSysId), reason: body.reason ?? "" }, + metadata + ) + return NextResponse.json({ base: response.base, data: response.data }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + return NextResponse.json({ base: { isSuccess: false, statusCode: "500", message: "Failed to unlock cost product master", validationErrors: [] } }, { status: 500 }) + } +} diff --git a/src/app/api/v1/finance/master/mb-lusture/[mblId]/route.ts b/src/app/api/v1/finance/master/mb-lusture/[mblId]/route.ts new file mode 100644 index 0000000..a159b06 --- /dev/null +++ b/src/app/api/v1/finance/master/mb-lusture/[mblId]/route.ts @@ -0,0 +1,64 @@ +// Finance MbLusture master routes - Update, Delete by ID + +import { NextRequest, NextResponse } from "next/server" +import { getMbLustureClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +type RouteContext = { params: Promise<{ mblId: string }> } + +// PUT /api/v1/finance/master/mb-lusture/[mblId] +export async function PUT(request: NextRequest, context: RouteContext) { + try { + const { mblId } = await context.params + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbLustureClient() + const response = await client.updateMbLusture({ ...body, mblId }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error updating MB Lusture:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to update MB lusture", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} + +// DELETE /api/v1/finance/master/mb-lusture/[mblId] +export async function DELETE(request: NextRequest, context: RouteContext) { + try { + const { mblId } = await context.params + const metadata = createMetadataFromRequest(request) + const client = getMbLustureClient() + const response = await client.deleteMbLusture({ mblId }, metadata) + + return NextResponse.json({ + base: response.base, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error deleting MB Lusture:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to delete MB lusture", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-lusture/export/route.ts b/src/app/api/v1/finance/master/mb-lusture/export/route.ts new file mode 100644 index 0000000..ada4dfa --- /dev/null +++ b/src/app/api/v1/finance/master/mb-lusture/export/route.ts @@ -0,0 +1,41 @@ +// GET /api/v1/finance/master/mb-lusture/export - Export MB Lustures to Excel + +import { NextRequest, NextResponse } from "next/server" +import { getMbLustureClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +export async function GET(request: NextRequest) { + try { + const { searchParams } = new URL(request.url) + const metadata = createMetadataFromRequest(request) + const client = getMbLustureClient() + + const response = await client.exportMbLusture( + { + activeFilter: Number(searchParams.get("activeFilter") || searchParams.get("active_filter")) || 0, + }, + metadata + ) + + const fileContentBase64 = Buffer.from(response.fileContent).toString('base64') + + return NextResponse.json({ + base: response.base, + fileContent: fileContentBase64, + fileName: response.fileName, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error exporting MB Lustures:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to export MB lustures", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-lusture/import/route.ts b/src/app/api/v1/finance/master/mb-lusture/import/route.ts new file mode 100644 index 0000000..cf11928 --- /dev/null +++ b/src/app/api/v1/finance/master/mb-lusture/import/route.ts @@ -0,0 +1,47 @@ +// POST /api/v1/finance/master/mb-lusture/import - Import MB Lustures from Excel + +import { NextRequest, NextResponse } from "next/server" +import { getMbLustureClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +export async function POST(request: NextRequest) { + try { + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbLustureClient() + + // Convert fileContent array to Uint8Array for gRPC + const fileContentBytes = new Uint8Array(body.fileContent) + + const response = await client.importMbLusture({ + fileContent: fileContentBytes, + fileName: body.fileName, + duplicateAction: body.duplicateAction, + }, metadata) + + return NextResponse.json({ + base: response.base, + successCount: response.successCount, + skippedCount: response.skippedCount, + failedCount: response.failedCount, + errors: response.errors, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error importing MB Lustures:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to import MB lustures", + validationErrors: [], + }, + successCount: 0, + skippedCount: 0, + failedCount: 0, + errors: [], + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-lusture/route.ts b/src/app/api/v1/finance/master/mb-lusture/route.ts new file mode 100644 index 0000000..be051f9 --- /dev/null +++ b/src/app/api/v1/finance/master/mb-lusture/route.ts @@ -0,0 +1,76 @@ +// Finance MbLusture master routes - List and Create + +import { NextRequest, NextResponse } from "next/server" +import { getMbLustureClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +// GET /api/v1/finance/master/mb-lusture - List MB Lusture records +export async function GET(request: NextRequest) { + try { + const { searchParams } = new URL(request.url) + const metadata = createMetadataFromRequest(request) + const client = getMbLustureClient() + + const response = await client.listMbLusture( + { + page: Number(searchParams.get("page")) || 1, + pageSize: Number(searchParams.get("pageSize") || searchParams.get("page_size")) || 10, + search: searchParams.get("search") || "", + sortBy: searchParams.get("sortBy") || searchParams.get("sort_by") || "", + sortDir: searchParams.get("sortDir") || searchParams.get("sort_dir") || "", + activeFilter: Number(searchParams.get("activeFilter") || searchParams.get("active_filter")) || 0, + }, + metadata + ) + + return NextResponse.json({ + base: response.base, + data: response.data, + pagination: response.pagination, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error fetching MB Lusture list:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to fetch MB lusture list", + validationErrors: [], + }, + data: [], + pagination: { currentPage: 1, pageSize: 10, totalItems: 0, totalPages: 0 }, + }, + { status: 500 } + ) + } +} + +// POST /api/v1/finance/master/mb-lusture - Create MB Lusture record +export async function POST(request: NextRequest) { + try { + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbLustureClient() + const response = await client.createMbLusture(body, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error creating MB Lusture:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to create MB lusture", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-lusture/template/route.ts b/src/app/api/v1/finance/master/mb-lusture/template/route.ts new file mode 100644 index 0000000..7a6c5ca --- /dev/null +++ b/src/app/api/v1/finance/master/mb-lusture/template/route.ts @@ -0,0 +1,35 @@ +// GET /api/v1/finance/master/mb-lusture/template - Download MB Lusture import template + +import { NextRequest, NextResponse } from "next/server" +import { getMbLustureClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +export async function GET(request: NextRequest) { + try { + const metadata = createMetadataFromRequest(request) + const client = getMbLustureClient() + const response = await client.downloadMbLustureTemplate({}, metadata) + + // Convert Uint8Array to base64 string for JSON serialization + const fileContentBase64 = Buffer.from(response.fileContent).toString('base64') + + return NextResponse.json({ + base: response.base, + fileContent: fileContentBase64, + fileName: response.fileName, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error downloading MB Lusture template:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to download template", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-param/[mbpId]/options/[mbpoId]/route.ts b/src/app/api/v1/finance/master/mb-param/[mbpId]/options/[mbpoId]/route.ts new file mode 100644 index 0000000..7f8723a --- /dev/null +++ b/src/app/api/v1/finance/master/mb-param/[mbpId]/options/[mbpoId]/route.ts @@ -0,0 +1,64 @@ +// Finance MbParamOption routes - Update, Delete picklist option by ID + +import { NextRequest, NextResponse } from "next/server" +import { getMbParamClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +type RouteContext = { params: Promise<{ mbpId: string; mbpoId: string }> } + +// PUT /api/v1/finance/master/mb-param/[mbpId]/options/[mbpoId] +export async function PUT(request: NextRequest, context: RouteContext) { + try { + const { mbpoId } = await context.params + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbParamClient() + const response = await client.updateMbParamOption({ ...body, mbpoId }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error updating MB Param option:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to update MB param option", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} + +// DELETE /api/v1/finance/master/mb-param/[mbpId]/options/[mbpoId] +export async function DELETE(request: NextRequest, context: RouteContext) { + try { + const { mbpoId } = await context.params + const metadata = createMetadataFromRequest(request) + const client = getMbParamClient() + const response = await client.deleteMbParamOption({ mbpoId }, metadata) + + return NextResponse.json({ + base: response.base, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error deleting MB Param option:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to delete MB param option", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-param/[mbpId]/options/route.ts b/src/app/api/v1/finance/master/mb-param/[mbpId]/options/route.ts new file mode 100644 index 0000000..40bdabf --- /dev/null +++ b/src/app/api/v1/finance/master/mb-param/[mbpId]/options/route.ts @@ -0,0 +1,33 @@ +// Finance MbParamOption routes - Create picklist option + +import { NextRequest, NextResponse } from "next/server" +import { getMbParamClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +// POST /api/v1/finance/master/mb-param/[mbpId]/options +export async function POST(request: NextRequest) { + try { + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbParamClient() + const response = await client.createMbParamOption(body, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error creating MB Param option:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to create MB param option", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-param/[mbpId]/route.ts b/src/app/api/v1/finance/master/mb-param/[mbpId]/route.ts new file mode 100644 index 0000000..e4d353f --- /dev/null +++ b/src/app/api/v1/finance/master/mb-param/[mbpId]/route.ts @@ -0,0 +1,64 @@ +// Finance MbParam master routes - Update, Delete by ID + +import { NextRequest, NextResponse } from "next/server" +import { getMbParamClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +type RouteContext = { params: Promise<{ mbpId: string }> } + +// PUT /api/v1/finance/master/mb-param/[mbpId] +export async function PUT(request: NextRequest, context: RouteContext) { + try { + const { mbpId } = await context.params + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbParamClient() + const response = await client.updateMbParam({ ...body, mbpId }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error updating MB Param:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to update MB param", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} + +// DELETE /api/v1/finance/master/mb-param/[mbpId] +export async function DELETE(request: NextRequest, context: RouteContext) { + try { + const { mbpId } = await context.params + const metadata = createMetadataFromRequest(request) + const client = getMbParamClient() + const response = await client.deleteMbParam({ mbpId }, metadata) + + return NextResponse.json({ + base: response.base, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error deleting MB Param:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to delete MB param", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-param/export/route.ts b/src/app/api/v1/finance/master/mb-param/export/route.ts new file mode 100644 index 0000000..0cb026b --- /dev/null +++ b/src/app/api/v1/finance/master/mb-param/export/route.ts @@ -0,0 +1,41 @@ +// GET /api/v1/finance/master/mb-param/export - Export MB Params to Excel + +import { NextRequest, NextResponse } from "next/server" +import { getMbParamClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +export async function GET(request: NextRequest) { + try { + const { searchParams } = new URL(request.url) + const metadata = createMetadataFromRequest(request) + const client = getMbParamClient() + + const response = await client.exportMbParams( + { + activeFilter: Number(searchParams.get("activeFilter") || searchParams.get("active_filter")) || 0, + }, + metadata + ) + + const fileContentBase64 = Buffer.from(response.fileContent).toString('base64') + + return NextResponse.json({ + base: response.base, + fileContent: fileContentBase64, + fileName: response.fileName, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error exporting MB Params:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to export MB params", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-param/import/route.ts b/src/app/api/v1/finance/master/mb-param/import/route.ts new file mode 100644 index 0000000..d519718 --- /dev/null +++ b/src/app/api/v1/finance/master/mb-param/import/route.ts @@ -0,0 +1,47 @@ +// POST /api/v1/finance/master/mb-param/import - Import MB Params from Excel + +import { NextRequest, NextResponse } from "next/server" +import { getMbParamClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +export async function POST(request: NextRequest) { + try { + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbParamClient() + + // Convert fileContent array to Uint8Array for gRPC + const fileContentBytes = new Uint8Array(body.fileContent) + + const response = await client.importMbParams({ + fileContent: fileContentBytes, + fileName: body.fileName, + duplicateAction: body.duplicateAction, + }, metadata) + + return NextResponse.json({ + base: response.base, + successCount: response.successCount, + skippedCount: response.skippedCount, + failedCount: response.failedCount, + errors: response.errors, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error importing MB Params:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to import MB params", + validationErrors: [], + }, + successCount: 0, + skippedCount: 0, + failedCount: 0, + errors: [], + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-param/route.ts b/src/app/api/v1/finance/master/mb-param/route.ts new file mode 100644 index 0000000..54e62e9 --- /dev/null +++ b/src/app/api/v1/finance/master/mb-param/route.ts @@ -0,0 +1,76 @@ +// Finance MbParam master routes - List and Create + +import { NextRequest, NextResponse } from "next/server" +import { getMbParamClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +// GET /api/v1/finance/master/mb-param - List MB Param records +export async function GET(request: NextRequest) { + try { + const { searchParams } = new URL(request.url) + const metadata = createMetadataFromRequest(request) + const client = getMbParamClient() + + const response = await client.listMbParams( + { + page: Number(searchParams.get("page")) || 1, + pageSize: Number(searchParams.get("pageSize") || searchParams.get("page_size")) || 10, + search: searchParams.get("search") || "", + sortBy: searchParams.get("sortBy") || searchParams.get("sort_by") || "", + sortDir: searchParams.get("sortDir") || searchParams.get("sort_dir") || "", + activeFilter: Number(searchParams.get("activeFilter") || searchParams.get("active_filter")) || 0, + }, + metadata + ) + + return NextResponse.json({ + base: response.base, + data: response.data, + pagination: response.pagination, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error fetching MB Param list:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to fetch MB param list", + validationErrors: [], + }, + data: [], + pagination: { currentPage: 1, pageSize: 10, totalItems: 0, totalPages: 0 }, + }, + { status: 500 } + ) + } +} + +// POST /api/v1/finance/master/mb-param - Create MB Param record +export async function POST(request: NextRequest) { + try { + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbParamClient() + const response = await client.createMbParam(body, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error creating MB Param:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to create MB param", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/master/mb-param/template/route.ts b/src/app/api/v1/finance/master/mb-param/template/route.ts new file mode 100644 index 0000000..2e3e0b5 --- /dev/null +++ b/src/app/api/v1/finance/master/mb-param/template/route.ts @@ -0,0 +1,35 @@ +// GET /api/v1/finance/master/mb-param/template - Download MB Param import template + +import { NextRequest, NextResponse } from "next/server" +import { getMbParamClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +export async function GET(request: NextRequest) { + try { + const metadata = createMetadataFromRequest(request) + const client = getMbParamClient() + const response = await client.downloadMbParamTemplate({}, metadata) + + // Convert Uint8Array to base64 string for JSON serialization + const fileContentBase64 = Buffer.from(response.fileContent).toString('base64') + + return NextResponse.json({ + base: response.base, + fileContent: fileContentBase64, + fileName: response.fileName, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error downloading MB Param template:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to download template", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-compositions/[mbcmId]/route.ts b/src/app/api/v1/finance/mb-compositions/[mbcmId]/route.ts new file mode 100644 index 0000000..3793313 --- /dev/null +++ b/src/app/api/v1/finance/mb-compositions/[mbcmId]/route.ts @@ -0,0 +1,64 @@ +// Finance MbComposition routes - Update, Delete by ID + +import { NextRequest, NextResponse } from "next/server" +import { getMbCompositionClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +type RouteContext = { params: Promise<{ mbcmId: string }> } + +// PUT /api/v1/finance/mb-compositions/[mbcmId] +export async function PUT(request: NextRequest, context: RouteContext) { + try { + const { mbcmId } = await context.params + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbCompositionClient() + const response = await client.updateMbComposition({ ...body, mbcmId }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error updating MB composition:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to update MB composition", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} + +// DELETE /api/v1/finance/mb-compositions/[mbcmId] +export async function DELETE(request: NextRequest, context: RouteContext) { + try { + const { mbcmId } = await context.params + const metadata = createMetadataFromRequest(request) + const client = getMbCompositionClient() + const response = await client.deleteMbComposition({ mbcmId }, metadata) + + return NextResponse.json({ + base: response.base, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error deleting MB composition:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to delete MB composition", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-compositions/route.ts b/src/app/api/v1/finance/mb-compositions/route.ts new file mode 100644 index 0000000..130a801 --- /dev/null +++ b/src/app/api/v1/finance/mb-compositions/route.ts @@ -0,0 +1,64 @@ +// Finance MbComposition routes - List by MB Head and Create + +import { NextRequest, NextResponse } from "next/server" +import { getMbCompositionClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +// GET /api/v1/finance/mb-compositions?mbhId=... +export async function GET(request: NextRequest) { + try { + const { searchParams } = new URL(request.url) + const mbhId = searchParams.get("mbhId") || "" + const metadata = createMetadataFromRequest(request) + const client = getMbCompositionClient() + const response = await client.listMbCompositions({ mbhId }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error fetching MB compositions:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to fetch MB compositions", + validationErrors: [], + }, + data: [], + }, + { status: 500 } + ) + } +} + +// POST /api/v1/finance/mb-compositions - Create composition line +export async function POST(request: NextRequest) { + try { + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbCompositionClient() + const response = await client.createMbComposition(body, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error creating MB composition:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to create MB composition", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-compositions/versions/route.ts b/src/app/api/v1/finance/mb-compositions/versions/route.ts new file mode 100644 index 0000000..68f7a06 --- /dev/null +++ b/src/app/api/v1/finance/mb-compositions/versions/route.ts @@ -0,0 +1,36 @@ +// Finance MbComposition routes - List frozen version snapshots for an MB Head + +import { NextRequest, NextResponse } from "next/server" +import { getMbCompositionClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +// GET /api/v1/finance/mb-compositions/versions?mbhId=...&version=... +export async function GET(request: NextRequest) { + try { + const { searchParams } = new URL(request.url) + const mbhId = searchParams.get("mbhId") || "" + const version = Number(searchParams.get("version")) || 0 + const metadata = createMetadataFromRequest(request) + const client = getMbCompositionClient() + const response = await client.listMbCompositionVersions({ mbhId, version }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error fetching MB composition versions:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to fetch MB composition versions", + validationErrors: [], + }, + data: [], + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-heads/[mbhId]/approve/route.ts b/src/app/api/v1/finance/mb-heads/[mbhId]/approve/route.ts new file mode 100644 index 0000000..f75c074 --- /dev/null +++ b/src/app/api/v1/finance/mb-heads/[mbhId]/approve/route.ts @@ -0,0 +1,35 @@ +// Finance MBHead workflow route - Approve + +import { NextRequest, NextResponse } from "next/server" +import { getMBHeadClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +type RouteContext = { params: Promise<{ mbhId: string }> } + +// POST /api/v1/finance/mb-heads/[mbhId]/approve +export async function POST(request: NextRequest, context: RouteContext) { + try { + const { mbhId } = await context.params + const metadata = createMetadataFromRequest(request) + const client = getMBHeadClient() + const response = await client.approveMBHead({ mbhId }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error approving MB Head:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to approve MB head", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-heads/[mbhId]/revoke/route.ts b/src/app/api/v1/finance/mb-heads/[mbhId]/revoke/route.ts new file mode 100644 index 0000000..e88a8ad --- /dev/null +++ b/src/app/api/v1/finance/mb-heads/[mbhId]/revoke/route.ts @@ -0,0 +1,36 @@ +// Finance MBHead workflow route - Revoke + +import { NextRequest, NextResponse } from "next/server" +import { getMBHeadClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +type RouteContext = { params: Promise<{ mbhId: string }> } + +// POST /api/v1/finance/mb-heads/[mbhId]/revoke +export async function POST(request: NextRequest, context: RouteContext) { + try { + const { mbhId } = await context.params + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMBHeadClient() + const response = await client.revokeMBHead({ mbhId, reason: body.reason ?? "" }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error revoking MB Head:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to revoke MB head", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-heads/[mbhId]/submit/route.ts b/src/app/api/v1/finance/mb-heads/[mbhId]/submit/route.ts new file mode 100644 index 0000000..ae99882 --- /dev/null +++ b/src/app/api/v1/finance/mb-heads/[mbhId]/submit/route.ts @@ -0,0 +1,35 @@ +// Finance MBHead workflow route - Submit for approval + +import { NextRequest, NextResponse } from "next/server" +import { getMBHeadClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +type RouteContext = { params: Promise<{ mbhId: string }> } + +// POST /api/v1/finance/mb-heads/[mbhId]/submit +export async function POST(request: NextRequest, context: RouteContext) { + try { + const { mbhId } = await context.params + const metadata = createMetadataFromRequest(request) + const client = getMBHeadClient() + const response = await client.submitMBHead({ mbhId }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error submitting MB Head:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to submit MB head", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-heads/[mbhId]/unapprove/route.ts b/src/app/api/v1/finance/mb-heads/[mbhId]/unapprove/route.ts new file mode 100644 index 0000000..5601bd8 --- /dev/null +++ b/src/app/api/v1/finance/mb-heads/[mbhId]/unapprove/route.ts @@ -0,0 +1,36 @@ +// Finance MBHead workflow route - Un-approve (revert out of approved state) + +import { NextRequest, NextResponse } from "next/server" +import { getMBHeadClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +type RouteContext = { params: Promise<{ mbhId: string }> } + +// POST /api/v1/finance/mb-heads/[mbhId]/unapprove +export async function POST(request: NextRequest, context: RouteContext) { + try { + const { mbhId } = await context.params + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMBHeadClient() + const response = await client.unApproveMBHead({ mbhId, reason: body.reason ?? "" }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error un-approving MB Head:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to un-approve MB head", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-heads/[mbhId]/validate/route.ts b/src/app/api/v1/finance/mb-heads/[mbhId]/validate/route.ts new file mode 100644 index 0000000..cb1730c --- /dev/null +++ b/src/app/api/v1/finance/mb-heads/[mbhId]/validate/route.ts @@ -0,0 +1,35 @@ +// Finance MBHead workflow route - Validate (freezes cost/param snapshot) + +import { NextRequest, NextResponse } from "next/server" +import { getMBHeadClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +type RouteContext = { params: Promise<{ mbhId: string }> } + +// POST /api/v1/finance/mb-heads/[mbhId]/validate +export async function POST(request: NextRequest, context: RouteContext) { + try { + const { mbhId } = await context.params + const metadata = createMetadataFromRequest(request) + const client = getMBHeadClient() + const response = await client.validateMBHead({ mbhId }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error validating MB Head:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to validate MB head", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-heads/export/route.ts b/src/app/api/v1/finance/mb-heads/export/route.ts new file mode 100644 index 0000000..3124828 --- /dev/null +++ b/src/app/api/v1/finance/mb-heads/export/route.ts @@ -0,0 +1,43 @@ +// GET /api/v1/finance/mb-heads/export - Export MB Heads to Excel + +import { NextRequest, NextResponse } from "next/server" +import { getMBHeadClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +export async function GET(request: NextRequest) { + try { + const { searchParams } = new URL(request.url) + const metadata = createMetadataFromRequest(request) + const client = getMBHeadClient() + + const response = await client.exportMBHeads( + { + activeFilter: Number(searchParams.get("activeFilter") || searchParams.get("active_filter")) || 0, + }, + metadata + ) + + // Convert Uint8Array to base64 string for JSON serialization + // Proto parser (bytesFromBase64) expects base64 string, not Uint8Array object + const fileContentBase64 = Buffer.from(response.fileContent).toString('base64') + + return NextResponse.json({ + base: response.base, + fileContent: fileContentBase64, + fileName: response.fileName, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error exporting MB Heads:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to export MB heads", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-heads/import/route.ts b/src/app/api/v1/finance/mb-heads/import/route.ts new file mode 100644 index 0000000..7bd8175 --- /dev/null +++ b/src/app/api/v1/finance/mb-heads/import/route.ts @@ -0,0 +1,47 @@ +// POST /api/v1/finance/mb-heads/import - Import MB Heads from Excel + +import { NextRequest, NextResponse } from "next/server" +import { getMBHeadClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +export async function POST(request: NextRequest) { + try { + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMBHeadClient() + + // Convert fileContent array to Uint8Array for gRPC + const fileContentBytes = new Uint8Array(body.fileContent) + + const response = await client.importMBHeads({ + fileContent: fileContentBytes, + fileName: body.fileName, + duplicateAction: body.duplicateAction, + }, metadata) + + return NextResponse.json({ + base: response.base, + successCount: response.successCount, + skippedCount: response.skippedCount, + failedCount: response.failedCount, + errors: response.errors, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error importing MB Heads:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to import MB heads", + validationErrors: [], + }, + successCount: 0, + skippedCount: 0, + failedCount: 0, + errors: [], + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-heads/template/route.ts b/src/app/api/v1/finance/mb-heads/template/route.ts new file mode 100644 index 0000000..7574a92 --- /dev/null +++ b/src/app/api/v1/finance/mb-heads/template/route.ts @@ -0,0 +1,35 @@ +// GET /api/v1/finance/mb-heads/template - Download MB Head import template + +import { NextRequest, NextResponse } from "next/server" +import { getMBHeadClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +export async function GET(request: NextRequest) { + try { + const metadata = createMetadataFromRequest(request) + const client = getMBHeadClient() + const response = await client.downloadMBHeadTemplate({}, metadata) + + // Convert Uint8Array to base64 string for JSON serialization + const fileContentBase64 = Buffer.from(response.fileContent).toString('base64') + + return NextResponse.json({ + base: response.base, + fileContent: fileContentBase64, + fileName: response.fileName, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error downloading MB Head template:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to download template", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-push-logs/route.ts b/src/app/api/v1/finance/mb-push-logs/route.ts new file mode 100644 index 0000000..11d15e1 --- /dev/null +++ b/src/app/api/v1/finance/mb-push-logs/route.ts @@ -0,0 +1,44 @@ +// Finance MbPush route - List push-to-head batch logs + +import { NextRequest, NextResponse } from "next/server" +import { getMbPushClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +// GET /api/v1/finance/mb-push-logs +export async function GET(request: NextRequest) { + try { + const { searchParams } = new URL(request.url) + const metadata = createMetadataFromRequest(request) + const client = getMbPushClient() + + const response = await client.listMbPushLogs( + { + page: Number(searchParams.get("page")) || 1, + pageSize: Number(searchParams.get("pageSize") || searchParams.get("page_size")) || 10, + period: searchParams.get("period") || "", + }, + metadata + ) + + return NextResponse.json({ + base: response.base, + data: response.data, + pagination: response.pagination, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error fetching push-to-head logs:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to fetch push-to-head logs", + validationErrors: [], + }, + data: [], + pagination: { currentPage: 1, pageSize: 10, totalItems: 0, totalPages: 0 }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-push/execute/route.ts b/src/app/api/v1/finance/mb-push/execute/route.ts new file mode 100644 index 0000000..af15759 --- /dev/null +++ b/src/app/api/v1/finance/mb-push/execute/route.ts @@ -0,0 +1,36 @@ +// Finance MbPush route - Execute push-to-head batch for a period + +import { NextRequest, NextResponse } from "next/server" +import { getMbPushClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +// POST /api/v1/finance/mb-push/execute +export async function POST(request: NextRequest) { + try { + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbPushClient() + const response = await client.executePushToHead( + { period: body.period ?? "", mbHeadIds: body.mbHeadIds ?? [] }, + metadata + ) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error executing push-to-head:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to execute push-to-head", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-push/preview/route.ts b/src/app/api/v1/finance/mb-push/preview/route.ts new file mode 100644 index 0000000..805d615 --- /dev/null +++ b/src/app/api/v1/finance/mb-push/preview/route.ts @@ -0,0 +1,33 @@ +// Finance MbPush route - Preview pushable/skipped MB Heads for a period + +import { NextRequest, NextResponse } from "next/server" +import { getMbPushClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +// POST /api/v1/finance/mb-push/preview +export async function POST(request: NextRequest) { + try { + const body = await request.json() + const metadata = createMetadataFromRequest(request) + const client = getMbPushClient() + const response = await client.previewPushToHead({ period: body.period ?? "" }, metadata) + + return NextResponse.json({ + base: response.base, + data: { pushable: response.pushable, skipped: response.skipped }, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error previewing push-to-head:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to preview push-to-head", + validationErrors: [], + }, + }, + { status: 500 } + ) + } +} diff --git a/src/app/api/v1/finance/mb-workflow-logs/route.ts b/src/app/api/v1/finance/mb-workflow-logs/route.ts new file mode 100644 index 0000000..71f99e6 --- /dev/null +++ b/src/app/api/v1/finance/mb-workflow-logs/route.ts @@ -0,0 +1,35 @@ +// Finance MbWorkflowLog route - List status transition audit trail for an MB Head + +import { NextRequest, NextResponse } from "next/server" +import { getMbWorkflowLogClient, createMetadataFromRequest, isGrpcError, handleGrpcError } from "@/lib/grpc" + +// GET /api/v1/finance/mb-workflow-logs?mbhId=... +export async function GET(request: NextRequest) { + try { + const { searchParams } = new URL(request.url) + const mbhId = searchParams.get("mbhId") || "" + const metadata = createMetadataFromRequest(request) + const client = getMbWorkflowLogClient() + const response = await client.listMbWorkflowLogs({ mbhId }, metadata) + + return NextResponse.json({ + base: response.base, + data: response.data, + }) + } catch (error) { + if (isGrpcError(error)) return handleGrpcError(error) + console.error("Error fetching MB workflow logs:", error) + return NextResponse.json( + { + base: { + isSuccess: false, + statusCode: "500", + message: "Failed to fetch MB workflow logs", + validationErrors: [], + }, + data: [], + }, + { status: 500 } + ) + } +} diff --git a/src/components/common/user-name.tsx b/src/components/common/user-name.tsx index 24e0895..c788e3b 100644 --- a/src/components/common/user-name.tsx +++ b/src/components/common/user-name.tsx @@ -7,6 +7,8 @@ // feedback_no_uuid_input.md. import { useUser } from "@/hooks/iam/use-users" +const UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i + interface Props { userId: string | undefined | null className?: string @@ -15,12 +17,23 @@ interface Props { } export function UserName({ userId, className, compact = false }: Props) { - const { data: resp, isLoading, error } = useUser(userId || "") + const isUUID = !!userId && UUID_PATTERN.test(userId) + // Some actor fields (e.g. mst_mb_workflow_log.mbwl_actor_user_id) store a plain + // username or service-account string rather than an IAM UUID — skip the lookup + // and render it directly instead of failing and showing "Unknown user". + const { data: resp, isLoading, error } = useUser(isUUID ? userId! : "") const detail = resp?.data ?? null const username = detail?.user?.username || "" const fullName = detail?.detail?.fullName || "" if (!userId) return + if (!isUUID) { + return ( + + {userId} + + ) + } if (isLoading) { return ( diff --git a/src/components/finance/comboboxes/mb-head-ref-combobox.tsx b/src/components/finance/comboboxes/mb-head-ref-combobox.tsx new file mode 100644 index 0000000..6d21398 --- /dev/null +++ b/src/components/finance/comboboxes/mb-head-ref-combobox.tsx @@ -0,0 +1,91 @@ +"use client" + +// MbHeadRefCombobox — picks another MB Head (mst_mb_head) by dev_code/shade_code/shade_name. +// Used by MB Recipe composition rows when source_type = MB (a carrier/base MB reference). +import { Check, ChevronsUpDown, Loader2 } from "lucide-react" +import { useMemo, useState } from "react" + +import { Button } from "@/components/ui/button" +import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command" +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover" +import { useMBHeads } from "@/hooks/finance/use-mb-head" +import { cn } from "@/lib/utils" + +interface MbHeadRefComboboxProps { + value: string | undefined + onChange: (mbhId: string, devCode: string, shadeName: string) => void + excludeMbhId?: string + placeholder?: string + disabled?: boolean + className?: string +} + +export function MbHeadRefCombobox({ + value, onChange, excludeMbhId, placeholder = "Select MB head…", disabled, className, +}: MbHeadRefComboboxProps) { + const [open, setOpen] = useState(false) + const [search, setSearch] = useState("") + const { data, isLoading } = useMBHeads({ search, pageSize: 50 }) + const filtered = useMemo( + () => (data?.data ?? []).filter((h) => h.mbhId !== excludeMbhId), + [data, excludeMbhId], + ) + const selected = useMemo(() => filtered.find((h) => h.mbhId === value), [filtered, value]) + + return ( + + + + + + + + + {isLoading && ( +
+ Loading… +
+ )} + No MB head matches. + + {filtered.map((h) => ( + { + onChange(h.mbhId, h.devCode, h.shadeName) + setOpen(false) + }} + > + +
+
+ {h.devCode} + {h.shadeName || h.shadeCode} +
+
+
+ ))} +
+
+
+
+
+ ) +} diff --git a/src/components/finance/comboboxes/rm-group-head-combobox.tsx b/src/components/finance/comboboxes/rm-group-head-combobox.tsx new file mode 100644 index 0000000..0b74f33 --- /dev/null +++ b/src/components/finance/comboboxes/rm-group-head-combobox.tsx @@ -0,0 +1,88 @@ +"use client" + +// RmGroupHeadCombobox — picks an RM Group (mst_rm_group_head) by group_code/group_name. +// Used by MB Recipe composition rows when source_type = GROUP. +import { Check, ChevronsUpDown, Loader2 } from "lucide-react" +import { useMemo, useState } from "react" + +import { Button } from "@/components/ui/button" +import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList } from "@/components/ui/command" +import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover" +import { useRMGroups } from "@/hooks/finance/use-rm-group" +import { ActiveFilter } from "@/types/generated/finance/v1/uom" +import { cn } from "@/lib/utils" + +interface RmGroupHeadComboboxProps { + value: string | undefined + onChange: (groupHeadId: string, groupCode: string, groupName: string) => void + placeholder?: string + disabled?: boolean + className?: string +} + +export function RmGroupHeadCombobox({ + value, onChange, placeholder = "Select RM group…", disabled, className, +}: RmGroupHeadComboboxProps) { + const [open, setOpen] = useState(false) + const [search, setSearch] = useState("") + const { data, isLoading } = useRMGroups({ search, activeFilter: ActiveFilter.ACTIVE_FILTER_ACTIVE, pageSize: 50 }) + const items = useMemo(() => data?.data ?? [], [data]) + const selected = useMemo(() => items.find((g) => g.groupHeadId === value), [items, value]) + + return ( + + + + + + + + + {isLoading && ( +
+ Loading… +
+ )} + No RM group matches. + + {items.map((g) => ( + { + onChange(g.groupHeadId, g.groupCode, g.groupName) + setOpen(false) + }} + > + +
+
+ {g.groupCode} + {g.groupName} +
+
+
+ ))} +
+
+
+
+
+ ) +} diff --git a/src/components/finance/cost-product-master/add-parameter-dialog.tsx b/src/components/finance/cost-product-master/add-parameter-dialog.tsx index 86aba4f..534902d 100644 --- a/src/components/finance/cost-product-master/add-parameter-dialog.tsx +++ b/src/components/finance/cost-product-master/add-parameter-dialog.tsx @@ -57,8 +57,9 @@ export function AddParameterDialog({ productSysId, open, onOpenChange }: Props) try { const isReq = overrides[entry.paramId] ?? entry.isRequiredForCosting const displayOrder = Number(displayOrders[entry.paramId] ?? 0) - const isMasterLookup = entry.paramCategory === "MASTER_LOOKUP" - const endpoint = isMasterLookup + const useChildrenEndpoint = + entry.paramCategory === "MASTER_LOOKUP" || entry.paramCategory === "CALCULATED" + const endpoint = useChildrenEndpoint ? "/api/v1/finance/cost-product-parameters/applicable/add-with-children" : "/api/v1/finance/cost-product-parameters/applicable/add" const res = await fetch(endpoint, { diff --git a/src/components/finance/cost-product-master/index.ts b/src/components/finance/cost-product-master/index.ts index 3884b7f..32dd3ea 100644 --- a/src/components/finance/cost-product-master/index.ts +++ b/src/components/finance/cost-product-master/index.ts @@ -7,3 +7,4 @@ export { } from "./product-master-table" export { ProductDetailDrawer } from "./product-detail-drawer" export { DeactivateProductMasterDialog } from "./deactivate-dialog" +export { UnlockProductMasterDialog } from "./unlock-dialog" diff --git a/src/components/finance/cost-product-master/master-lookup-field.tsx b/src/components/finance/cost-product-master/master-lookup-field.tsx index 950427d..27272db 100644 --- a/src/components/finance/cost-product-master/master-lookup-field.tsx +++ b/src/components/finance/cost-product-master/master-lookup-field.tsx @@ -29,6 +29,7 @@ interface MasterLookupFieldProps { selectedKey: string, fills: LookupFillValuesResponse | null ) => void + disabled?: boolean } export function MasterLookupField({ @@ -36,6 +37,7 @@ export function MasterLookupField({ draft, allEntries: _allEntries, onChangeLookup, + disabled, }: MasterLookupFieldProps) { const [open, setOpen] = useState(false) const [loading, setLoading] = useState(false) @@ -87,7 +89,7 @@ export function MasterLookupField({ role="combobox" aria-expanded={open} className="w-full justify-between font-normal h-9 px-3" - disabled={loading} + disabled={loading || disabled} > {loading ? ( diff --git a/src/components/finance/cost-product-master/parameters-tab.tsx b/src/components/finance/cost-product-master/parameters-tab.tsx index 7323b1b..68c449c 100644 --- a/src/components/finance/cost-product-master/parameters-tab.tsx +++ b/src/components/finance/cost-product-master/parameters-tab.tsx @@ -14,6 +14,7 @@ import { Button } from "@/components/ui/button" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select" import { Switch } from "@/components/ui/switch" import { useProductRequiredParams, @@ -21,6 +22,7 @@ import { useMissingRequiredParams, useRemoveApplicableParam, } from "@/hooks/finance/use-cost-product-parameter" +import { useMbParams } from "@/hooks/finance/use-mb-param" import type { RequiredParamEntry, UpsertParamValuePayload } from "@/types/finance/cost-product-parameter" import type { LookupFillValuesResponse } from "@/types/finance/yarn-master" import type { RemoveApplicablePreview } from "@/types/finance/lookup-master" @@ -32,6 +34,7 @@ import { toast } from "sonner" interface ParametersTabProps { productSysId: number + isLocked?: boolean } export interface DraftValue { @@ -52,7 +55,7 @@ function emptyDraft(entry: RequiredParamEntry): DraftValue { } } -export function ProductParametersTab({ productSysId }: ParametersTabProps) { +export function ProductParametersTab({ productSysId, isLocked = false }: ParametersTabProps) { const { data, isLoading } = useProductRequiredParams(productSysId) const { data: missing } = useMissingRequiredParams(productSysId) const upsertM = useUpsertProductParamValuesBatch() @@ -218,7 +221,7 @@ export function ProductParametersTab({ productSysId }: ParametersTabProps) {

No parameters are applicable to this product yet.

-
@@ -249,10 +252,10 @@ export function ProductParametersTab({ productSysId }: ParametersTabProps) { )}
- -