From 64a946d031d27bd81902d2c8f0960c753db619a0 Mon Sep 17 00:00:00 2001 From: Hamid Tavakoli Date: Mon, 27 Feb 2023 02:04:28 -0600 Subject: [PATCH 1/8] feat(submission): wip- legacy submission --- package.json | 6 +- src/config.ts | 13 + src/domain/LegacySubmission.ts | 98 + src/helper/QueryRunner.ts | 2 +- src/models/domain-layer/legacy/challenge.ts | 692 +++-- .../domain-layer/legacy/challenge_payment.ts | 507 +++- .../legacy/group_contest_eligibility.ts | 531 ++++ .../domain-layer/legacy/notification.ts | 292 +++ src/models/domain-layer/legacy/payment.ts | 1134 +++++++++ src/models/domain-layer/legacy/phase.ts | 1540 +++++++++++ src/models/domain-layer/legacy/prize.ts | 67 + .../domain-layer/legacy/project_info.ts | 682 +++++ src/models/domain-layer/legacy/resource.ts | 746 ++++++ .../legacy/resource_submission.ts | 69 + src/models/domain-layer/legacy/review.ts | 2242 +++++++++++++++++ .../domain-layer/legacy/services/challenge.ts | 61 +- .../legacy/services/challenge_payment.ts | 62 + .../legacy/services/challenge_phase.ts | 4 +- .../services/group_contest_eligibility.ts | 88 + .../legacy/services/notification.ts | 31 + .../domain-layer/legacy/services/payment.ts | 105 + .../domain-layer/legacy/services/phase.ts | 114 + .../domain-layer/legacy/services/prize.ts | 34 +- .../legacy/services/project_info.ts | 69 + .../domain-layer/legacy/services/resource.ts | 58 + .../domain-layer/legacy/services/review.ts | 41 + .../legacy/services/submission.ts | 67 + .../domain-layer/legacy/services/sync.ts | 21 + .../domain-layer/legacy/services/term.ts | 50 + src/models/domain-layer/legacy/submission.ts | 565 +++++ src/models/domain-layer/legacy/sync.ts | 172 ++ src/models/domain-layer/legacy/term.ts | 471 ++++ src/models/domain-layer/legacy/user.ts | 186 ++ src/server.ts | 9 +- src/service/LegacyChallenge.ts | 2 +- src/service/LegacySubmission.ts | 48 + yarn.lock | 289 ++- 37 files changed, 10775 insertions(+), 393 deletions(-) create mode 100644 src/config.ts create mode 100644 src/domain/LegacySubmission.ts create mode 100644 src/models/domain-layer/legacy/group_contest_eligibility.ts create mode 100644 src/models/domain-layer/legacy/notification.ts create mode 100644 src/models/domain-layer/legacy/payment.ts create mode 100644 src/models/domain-layer/legacy/phase.ts create mode 100644 src/models/domain-layer/legacy/project_info.ts create mode 100644 src/models/domain-layer/legacy/review.ts create mode 100644 src/models/domain-layer/legacy/services/challenge_payment.ts create mode 100644 src/models/domain-layer/legacy/services/group_contest_eligibility.ts create mode 100644 src/models/domain-layer/legacy/services/notification.ts create mode 100644 src/models/domain-layer/legacy/services/payment.ts create mode 100644 src/models/domain-layer/legacy/services/phase.ts create mode 100644 src/models/domain-layer/legacy/services/project_info.ts create mode 100644 src/models/domain-layer/legacy/services/resource.ts create mode 100644 src/models/domain-layer/legacy/services/review.ts create mode 100644 src/models/domain-layer/legacy/services/submission.ts create mode 100644 src/models/domain-layer/legacy/services/sync.ts create mode 100644 src/models/domain-layer/legacy/services/term.ts create mode 100644 src/models/domain-layer/legacy/submission.ts create mode 100644 src/models/domain-layer/legacy/sync.ts create mode 100644 src/models/domain-layer/legacy/term.ts create mode 100644 src/models/domain-layer/legacy/user.ts create mode 100644 src/service/LegacySubmission.ts diff --git a/package.json b/package.json index 8a55880..0a24b72 100644 --- a/package.json +++ b/package.json @@ -16,8 +16,8 @@ "license": "ISC", "dependencies": { "@grpc/grpc-js": "^1.7.1", - "@topcoder-framework/client-relational": "^0.4.24-ci.0", - "@topcoder-framework/lib-common": "^0.4.24-ci.0", + "@topcoder-framework/client-relational": "^0.5.1-ci.0", + "@topcoder-framework/lib-common": "^0.5.1-ci.0", "dayjs": "^1.11.5", "dotenv": "^16.0.3", "grpc-server-reflection": "^0.1.5", @@ -37,4 +37,4 @@ "node": "18.13.0", "yarn": "1.22.19" } -} +} \ No newline at end of file diff --git a/src/config.ts b/src/config.ts new file mode 100644 index 0000000..27ee29d --- /dev/null +++ b/src/config.ts @@ -0,0 +1,13 @@ +import * as dotenv from "dotenv"; +import assert from "assert"; +dotenv.config(); + +export const ENV = process.env.ENV || "local"; +export const GRPC_SERVER_HOST = process.env.GRPC_SERVER_HOST || ""; +export const GRPC_SERVER_PORT = process.env.GRPC_SERVER_PORT || 9091; + +export const GRPC_RDB_SERVER_HOST = process.env.GRPC_RDB_SERVER_HOST; +export const GRPC_RDB_SERVER_PORT = process.env.GRPC_RDB_SERVER_PORT; + +assert(GRPC_RDB_SERVER_HOST, "GRPC_RDB_SERVER_HOST is required"); +assert(GRPC_RDB_SERVER_PORT, "GRPC_RDB_SERVER_PORT is required"); \ No newline at end of file diff --git a/src/domain/LegacySubmission.ts b/src/domain/LegacySubmission.ts new file mode 100644 index 0000000..4ac999c --- /dev/null +++ b/src/domain/LegacySubmission.ts @@ -0,0 +1,98 @@ +import { Operator, QueryBuilder } from "@topcoder-framework/client-relational"; +import { queryRunner } from "../helper/QueryRunner"; +import { + CreateSubmissionInput, +} from "../models/domain-layer/legacy/submission"; +import { ProjectSchema } from "../schema/project/Project"; + +class LegacySubmissionDomain { + public async checkSubmissionExists( + legacySubmissionId: number + ): Promise { + const { projectId } = ProjectSchema.columns; + + const query = new QueryBuilder(ProjectSchema) + .select(projectId) + .where(projectId, Operator.OPERATOR_EQUAL, { + value: { + $case: "intValue", + intValue: legacySubmissionId, + }, + }) + .limit(1) + .build(); + + const { rows } = await queryRunner.run(query); + + return { + exists: rows?.length == 1, + }; + } + + public async createLegacySubmission(input: CreateSubmissionInput): Promise { + const transaction = queryRunner.beginTransaction(); + + const createLegacySubmissionQuery = new QueryBuilder(ProjectSchema) + .insert({ + submissionStatusId: input.submissionStatusId, + submissionTypeId: input.submissionTypeId, + uploadId: input.uploadId, + createUser: input.createUser, + modifyUser: input.modifyUser, + createDate: input.createDate, + modifyDate: input.modifyDate, + }) + .build(); + + const createLegacySubmissionQueryResult = await transaction.add(createLegacySubmissionQuery); + if (createLegacySubmissionQueryResult instanceof Error) { + transaction.rollback(); + return Promise.reject({ + message: "Failed to create legacy submission", + }); + } + + const { lastInsertId: legacySubmissionId } = createLegacySubmissionQueryResult; + + return Promise.resolve(legacySubmissionId!); + } + + // public async listAvailableSubmissionInfoTypes(key: string): Promise { + // const queryRequest: QueryRequest = { + // query: { + // query: { + // $case: "select", + // select: { + // table: "project_info_type_lu", + // join: [], + // column: [ + // { + // name: "", + // type: ColumnType.COLUMN_TYPE_INT, + // }, + // ], + // where: [ + // { + // key: "name", + // operator: Operator.OPERATOR_EQUAL, + // value: { + // value: { + // $case: "stringValue", + // stringValue: key, + // }, + // }, + // }, + // ], + // groupBy: [], + // orderBy: [], + // limit: 1, + // offset: 0, + // }, + // }, + // }, + // }; + // return Promise.resolve(10); + // } +} + +export default new LegacySubmissionDomain(); diff --git a/src/helper/QueryRunner.ts b/src/helper/QueryRunner.ts index befc96e..67fc536 100644 --- a/src/helper/QueryRunner.ts +++ b/src/helper/QueryRunner.ts @@ -1,4 +1,4 @@ -const { GRPC_RDB_SERVER_HOST, GRPC_RDB_SERVER_PORT } = process.env; +import { GRPC_RDB_SERVER_HOST, GRPC_RDB_SERVER_PORT } from '../config' import { QueryRunner } from "@topcoder-framework/client-relational"; diff --git a/src/models/domain-layer/legacy/challenge.ts b/src/models/domain-layer/legacy/challenge.ts index 804f16f..309fd31 100644 --- a/src/models/domain-layer/legacy/challenge.ts +++ b/src/models/domain-layer/legacy/challenge.ts @@ -21,34 +21,60 @@ export interface LegacyChallengeList { legacyChallenges: LegacyChallenge[]; } -export interface CheckChallengeExistsResponse { - exists: boolean; -} - export interface CreateChallengeInput { name: string; projectStatusId: number; projectCategoryId: number; + projectStudioSpecId?: number | undefined; + projectMmSpecId?: number | undefined; tcDirectProjectId: number; - winnerPrizes: number[]; - copilotCost: number; + winnerPrizes: CreateChallengeInput_Prize[]; reviewType?: string | undefined; - reviewCost?: number | undefined; - timelineNotification: boolean; - statusNotification: boolean; - rated: boolean; confidentialityType: string; billingProject: number; - reliabilityBonusCost?: number | undefined; - checkpointBonusCost?: number | undefined; - projectInfo: { [key: string]: string }; + projectInfo: { [key: number]: string }; + phases: CreateChallengeInput_Phase[]; } export interface CreateChallengeInput_ProjectInfoEntry { - key: string; + key: number; value: string; } +export interface CreateChallengeInput_Prize { + place: number; + amount: number; + type: string; + numSubmissions: number; +} + +export interface CreateChallengeInput_Phase { + phaseTypeId: number; + phaseStatusId: number; + fixedStartTime?: string | undefined; + scheduledStartTime: string; + scheduledEndTime: string; + actualStartTime?: string | undefined; + actualEndTime?: string | undefined; + duration: number; + phaseCriteria: { [key: number]: string }; +} + +export interface CreateChallengeInput_Phase_PhaseCriteriaEntry { + key: number; + value: string; +} + +export interface UpdateChallengeInput { + projectId: number; + projectStatusId: number; +} + +export interface CloseChallengeInput { + projectId: number; + winnerId: number; +} + function createBaseLegacyChallenge(): LegacyChallenge { return { projectId: 0, @@ -284,75 +310,20 @@ export const LegacyChallengeList = { }, }; -function createBaseCheckChallengeExistsResponse(): CheckChallengeExistsResponse { - return { exists: false }; -} - -export const CheckChallengeExistsResponse = { - encode(message: CheckChallengeExistsResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.exists === true) { - writer.uint32(8).bool(message.exists); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): CheckChallengeExistsResponse { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseCheckChallengeExistsResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.exists = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): CheckChallengeExistsResponse { - return { exists: isSet(object.exists) ? Boolean(object.exists) : false }; - }, - - toJSON(message: CheckChallengeExistsResponse): unknown { - const obj: any = {}; - message.exists !== undefined && (obj.exists = message.exists); - return obj; - }, - - create, I>>(base?: I): CheckChallengeExistsResponse { - return CheckChallengeExistsResponse.fromPartial(base ?? {}); - }, - - fromPartial, I>>(object: I): CheckChallengeExistsResponse { - const message = createBaseCheckChallengeExistsResponse(); - message.exists = object.exists ?? false; - return message; - }, -}; - function createBaseCreateChallengeInput(): CreateChallengeInput { return { name: "", projectStatusId: 0, projectCategoryId: 0, + projectStudioSpecId: undefined, + projectMmSpecId: undefined, tcDirectProjectId: 0, winnerPrizes: [], - copilotCost: 0, reviewType: undefined, - reviewCost: undefined, - timelineNotification: false, - statusNotification: false, - rated: false, confidentialityType: "", billingProject: 0, - reliabilityBonusCost: undefined, - checkpointBonusCost: undefined, projectInfo: {}, + phases: [], }; } @@ -367,47 +338,33 @@ export const CreateChallengeInput = { if (message.projectCategoryId !== 0) { writer.uint32(24).int32(message.projectCategoryId); } + if (message.projectStudioSpecId !== undefined) { + writer.uint32(32).int32(message.projectStudioSpecId); + } + if (message.projectMmSpecId !== undefined) { + writer.uint32(40).int32(message.projectMmSpecId); + } if (message.tcDirectProjectId !== 0) { - writer.uint32(32).int64(message.tcDirectProjectId); + writer.uint32(48).int64(message.tcDirectProjectId); } - writer.uint32(42).fork(); for (const v of message.winnerPrizes) { - writer.float(v); - } - writer.ldelim(); - if (message.copilotCost !== 0) { - writer.uint32(53).float(message.copilotCost); + CreateChallengeInput_Prize.encode(v!, writer.uint32(58).fork()).ldelim(); } if (message.reviewType !== undefined) { - writer.uint32(58).string(message.reviewType); - } - if (message.reviewCost !== undefined) { - writer.uint32(69).float(message.reviewCost); - } - if (message.timelineNotification === true) { - writer.uint32(72).bool(message.timelineNotification); - } - if (message.statusNotification === true) { - writer.uint32(80).bool(message.statusNotification); - } - if (message.rated === true) { - writer.uint32(88).bool(message.rated); + writer.uint32(66).string(message.reviewType); } if (message.confidentialityType !== "") { - writer.uint32(98).string(message.confidentialityType); + writer.uint32(74).string(message.confidentialityType); } if (message.billingProject !== 0) { - writer.uint32(104).int32(message.billingProject); - } - if (message.reliabilityBonusCost !== undefined) { - writer.uint32(117).float(message.reliabilityBonusCost); - } - if (message.checkpointBonusCost !== undefined) { - writer.uint32(125).float(message.checkpointBonusCost); + writer.uint32(80).int32(message.billingProject); } Object.entries(message.projectInfo).forEach(([key, value]) => { - CreateChallengeInput_ProjectInfoEntry.encode({ key: key as any, value }, writer.uint32(130).fork()).ldelim(); + CreateChallengeInput_ProjectInfoEntry.encode({ key: key as any, value }, writer.uint32(90).fork()).ldelim(); }); + for (const v of message.phases) { + CreateChallengeInput_Phase.encode(v!, writer.uint32(106).fork()).ldelim(); + } return writer; }, @@ -428,53 +385,34 @@ export const CreateChallengeInput = { message.projectCategoryId = reader.int32(); break; case 4: - message.tcDirectProjectId = longToNumber(reader.int64() as Long); + message.projectStudioSpecId = reader.int32(); break; case 5: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.winnerPrizes.push(reader.float()); - } - } else { - message.winnerPrizes.push(reader.float()); - } + message.projectMmSpecId = reader.int32(); break; case 6: - message.copilotCost = reader.float(); + message.tcDirectProjectId = longToNumber(reader.int64() as Long); break; case 7: - message.reviewType = reader.string(); + message.winnerPrizes.push(CreateChallengeInput_Prize.decode(reader, reader.uint32())); break; case 8: - message.reviewCost = reader.float(); + message.reviewType = reader.string(); break; case 9: - message.timelineNotification = reader.bool(); + message.confidentialityType = reader.string(); break; case 10: - message.statusNotification = reader.bool(); + message.billingProject = reader.int32(); break; case 11: - message.rated = reader.bool(); - break; - case 12: - message.confidentialityType = reader.string(); + const entry11 = CreateChallengeInput_ProjectInfoEntry.decode(reader, reader.uint32()); + if (entry11.value !== undefined) { + message.projectInfo[entry11.key] = entry11.value; + } break; case 13: - message.billingProject = reader.int32(); - break; - case 14: - message.reliabilityBonusCost = reader.float(); - break; - case 15: - message.checkpointBonusCost = reader.float(); - break; - case 16: - const entry16 = CreateChallengeInput_ProjectInfoEntry.decode(reader, reader.uint32()); - if (entry16.value !== undefined) { - message.projectInfo[entry16.key] = entry16.value; - } + message.phases.push(CreateChallengeInput_Phase.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -489,24 +427,24 @@ export const CreateChallengeInput = { name: isSet(object.name) ? String(object.name) : "", projectStatusId: isSet(object.projectStatusId) ? Number(object.projectStatusId) : 0, projectCategoryId: isSet(object.projectCategoryId) ? Number(object.projectCategoryId) : 0, + projectStudioSpecId: isSet(object.projectStudioSpecId) ? Number(object.projectStudioSpecId) : undefined, + projectMmSpecId: isSet(object.projectMmSpecId) ? Number(object.projectMmSpecId) : undefined, tcDirectProjectId: isSet(object.tcDirectProjectId) ? Number(object.tcDirectProjectId) : 0, - winnerPrizes: Array.isArray(object?.winnerPrizes) ? object.winnerPrizes.map((e: any) => Number(e)) : [], - copilotCost: isSet(object.copilotCost) ? Number(object.copilotCost) : 0, + winnerPrizes: Array.isArray(object?.winnerPrizes) + ? object.winnerPrizes.map((e: any) => CreateChallengeInput_Prize.fromJSON(e)) + : [], reviewType: isSet(object.reviewType) ? String(object.reviewType) : undefined, - reviewCost: isSet(object.reviewCost) ? Number(object.reviewCost) : undefined, - timelineNotification: isSet(object.timelineNotification) ? Boolean(object.timelineNotification) : false, - statusNotification: isSet(object.statusNotification) ? Boolean(object.statusNotification) : false, - rated: isSet(object.rated) ? Boolean(object.rated) : false, confidentialityType: isSet(object.confidentialityType) ? String(object.confidentialityType) : "", billingProject: isSet(object.billingProject) ? Number(object.billingProject) : 0, - reliabilityBonusCost: isSet(object.reliabilityBonusCost) ? Number(object.reliabilityBonusCost) : undefined, - checkpointBonusCost: isSet(object.checkpointBonusCost) ? Number(object.checkpointBonusCost) : undefined, projectInfo: isObject(object.projectInfo) - ? Object.entries(object.projectInfo).reduce<{ [key: string]: string }>((acc, [key, value]) => { - acc[key] = String(value); + ? Object.entries(object.projectInfo).reduce<{ [key: number]: string }>((acc, [key, value]) => { + acc[Number(key)] = String(value); return acc; }, {}) : {}, + phases: Array.isArray(object?.phases) + ? object.phases.map((e: any) => CreateChallengeInput_Phase.fromJSON(e)) + : [], }; }, @@ -515,28 +453,28 @@ export const CreateChallengeInput = { message.name !== undefined && (obj.name = message.name); message.projectStatusId !== undefined && (obj.projectStatusId = Math.round(message.projectStatusId)); message.projectCategoryId !== undefined && (obj.projectCategoryId = Math.round(message.projectCategoryId)); + message.projectStudioSpecId !== undefined && (obj.projectStudioSpecId = Math.round(message.projectStudioSpecId)); + message.projectMmSpecId !== undefined && (obj.projectMmSpecId = Math.round(message.projectMmSpecId)); message.tcDirectProjectId !== undefined && (obj.tcDirectProjectId = Math.round(message.tcDirectProjectId)); if (message.winnerPrizes) { - obj.winnerPrizes = message.winnerPrizes.map((e) => e); + obj.winnerPrizes = message.winnerPrizes.map((e) => e ? CreateChallengeInput_Prize.toJSON(e) : undefined); } else { obj.winnerPrizes = []; } - message.copilotCost !== undefined && (obj.copilotCost = message.copilotCost); message.reviewType !== undefined && (obj.reviewType = message.reviewType); - message.reviewCost !== undefined && (obj.reviewCost = message.reviewCost); - message.timelineNotification !== undefined && (obj.timelineNotification = message.timelineNotification); - message.statusNotification !== undefined && (obj.statusNotification = message.statusNotification); - message.rated !== undefined && (obj.rated = message.rated); message.confidentialityType !== undefined && (obj.confidentialityType = message.confidentialityType); message.billingProject !== undefined && (obj.billingProject = Math.round(message.billingProject)); - message.reliabilityBonusCost !== undefined && (obj.reliabilityBonusCost = message.reliabilityBonusCost); - message.checkpointBonusCost !== undefined && (obj.checkpointBonusCost = message.checkpointBonusCost); obj.projectInfo = {}; if (message.projectInfo) { Object.entries(message.projectInfo).forEach(([k, v]) => { obj.projectInfo[k] = v; }); } + if (message.phases) { + obj.phases = message.phases.map((e) => e ? CreateChallengeInput_Phase.toJSON(e) : undefined); + } else { + obj.phases = []; + } return obj; }, @@ -549,39 +487,35 @@ export const CreateChallengeInput = { message.name = object.name ?? ""; message.projectStatusId = object.projectStatusId ?? 0; message.projectCategoryId = object.projectCategoryId ?? 0; + message.projectStudioSpecId = object.projectStudioSpecId ?? undefined; + message.projectMmSpecId = object.projectMmSpecId ?? undefined; message.tcDirectProjectId = object.tcDirectProjectId ?? 0; - message.winnerPrizes = object.winnerPrizes?.map((e) => e) || []; - message.copilotCost = object.copilotCost ?? 0; + message.winnerPrizes = object.winnerPrizes?.map((e) => CreateChallengeInput_Prize.fromPartial(e)) || []; message.reviewType = object.reviewType ?? undefined; - message.reviewCost = object.reviewCost ?? undefined; - message.timelineNotification = object.timelineNotification ?? false; - message.statusNotification = object.statusNotification ?? false; - message.rated = object.rated ?? false; message.confidentialityType = object.confidentialityType ?? ""; message.billingProject = object.billingProject ?? 0; - message.reliabilityBonusCost = object.reliabilityBonusCost ?? undefined; - message.checkpointBonusCost = object.checkpointBonusCost ?? undefined; - message.projectInfo = Object.entries(object.projectInfo ?? {}).reduce<{ [key: string]: string }>( + message.projectInfo = Object.entries(object.projectInfo ?? {}).reduce<{ [key: number]: string }>( (acc, [key, value]) => { if (value !== undefined) { - acc[key] = String(value); + acc[Number(key)] = String(value); } return acc; }, {}, ); + message.phases = object.phases?.map((e) => CreateChallengeInput_Phase.fromPartial(e)) || []; return message; }, }; function createBaseCreateChallengeInput_ProjectInfoEntry(): CreateChallengeInput_ProjectInfoEntry { - return { key: "", value: "" }; + return { key: 0, value: "" }; } export const CreateChallengeInput_ProjectInfoEntry = { encode(message: CreateChallengeInput_ProjectInfoEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.key !== "") { - writer.uint32(10).string(message.key); + if (message.key !== 0) { + writer.uint32(8).sint32(message.key); } if (message.value !== "") { writer.uint32(18).string(message.value); @@ -597,7 +531,7 @@ export const CreateChallengeInput_ProjectInfoEntry = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.key = reader.string(); + message.key = reader.sint32(); break; case 2: message.value = reader.string(); @@ -611,12 +545,12 @@ export const CreateChallengeInput_ProjectInfoEntry = { }, fromJSON(object: any): CreateChallengeInput_ProjectInfoEntry { - return { key: isSet(object.key) ? String(object.key) : "", value: isSet(object.value) ? String(object.value) : "" }; + return { key: isSet(object.key) ? Number(object.key) : 0, value: isSet(object.value) ? String(object.value) : "" }; }, toJSON(message: CreateChallengeInput_ProjectInfoEntry): unknown { const obj: any = {}; - message.key !== undefined && (obj.key = message.key); + message.key !== undefined && (obj.key = Math.round(message.key)); message.value !== undefined && (obj.value = message.value); return obj; }, @@ -631,12 +565,436 @@ export const CreateChallengeInput_ProjectInfoEntry = { object: I, ): CreateChallengeInput_ProjectInfoEntry { const message = createBaseCreateChallengeInput_ProjectInfoEntry(); - message.key = object.key ?? ""; + message.key = object.key ?? 0; message.value = object.value ?? ""; return message; }, }; +function createBaseCreateChallengeInput_Prize(): CreateChallengeInput_Prize { + return { place: 0, amount: 0, type: "", numSubmissions: 0 }; +} + +export const CreateChallengeInput_Prize = { + encode(message: CreateChallengeInput_Prize, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.place !== 0) { + writer.uint32(8).int32(message.place); + } + if (message.amount !== 0) { + writer.uint32(21).float(message.amount); + } + if (message.type !== "") { + writer.uint32(26).string(message.type); + } + if (message.numSubmissions !== 0) { + writer.uint32(32).int32(message.numSubmissions); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateChallengeInput_Prize { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateChallengeInput_Prize(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.place = reader.int32(); + break; + case 2: + message.amount = reader.float(); + break; + case 3: + message.type = reader.string(); + break; + case 4: + message.numSubmissions = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateChallengeInput_Prize { + return { + place: isSet(object.place) ? Number(object.place) : 0, + amount: isSet(object.amount) ? Number(object.amount) : 0, + type: isSet(object.type) ? String(object.type) : "", + numSubmissions: isSet(object.numSubmissions) ? Number(object.numSubmissions) : 0, + }; + }, + + toJSON(message: CreateChallengeInput_Prize): unknown { + const obj: any = {}; + message.place !== undefined && (obj.place = Math.round(message.place)); + message.amount !== undefined && (obj.amount = message.amount); + message.type !== undefined && (obj.type = message.type); + message.numSubmissions !== undefined && (obj.numSubmissions = Math.round(message.numSubmissions)); + return obj; + }, + + create, I>>(base?: I): CreateChallengeInput_Prize { + return CreateChallengeInput_Prize.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateChallengeInput_Prize { + const message = createBaseCreateChallengeInput_Prize(); + message.place = object.place ?? 0; + message.amount = object.amount ?? 0; + message.type = object.type ?? ""; + message.numSubmissions = object.numSubmissions ?? 0; + return message; + }, +}; + +function createBaseCreateChallengeInput_Phase(): CreateChallengeInput_Phase { + return { + phaseTypeId: 0, + phaseStatusId: 0, + fixedStartTime: undefined, + scheduledStartTime: "", + scheduledEndTime: "", + actualStartTime: undefined, + actualEndTime: undefined, + duration: 0, + phaseCriteria: {}, + }; +} + +export const CreateChallengeInput_Phase = { + encode(message: CreateChallengeInput_Phase, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.phaseTypeId !== 0) { + writer.uint32(8).sint32(message.phaseTypeId); + } + if (message.phaseStatusId !== 0) { + writer.uint32(16).sint32(message.phaseStatusId); + } + if (message.fixedStartTime !== undefined) { + writer.uint32(26).string(message.fixedStartTime); + } + if (message.scheduledStartTime !== "") { + writer.uint32(34).string(message.scheduledStartTime); + } + if (message.scheduledEndTime !== "") { + writer.uint32(42).string(message.scheduledEndTime); + } + if (message.actualStartTime !== undefined) { + writer.uint32(50).string(message.actualStartTime); + } + if (message.actualEndTime !== undefined) { + writer.uint32(58).string(message.actualEndTime); + } + if (message.duration !== 0) { + writer.uint32(64).int32(message.duration); + } + Object.entries(message.phaseCriteria).forEach(([key, value]) => { + CreateChallengeInput_Phase_PhaseCriteriaEntry.encode({ key: key as any, value }, writer.uint32(74).fork()) + .ldelim(); + }); + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateChallengeInput_Phase { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateChallengeInput_Phase(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.phaseTypeId = reader.sint32(); + break; + case 2: + message.phaseStatusId = reader.sint32(); + break; + case 3: + message.fixedStartTime = reader.string(); + break; + case 4: + message.scheduledStartTime = reader.string(); + break; + case 5: + message.scheduledEndTime = reader.string(); + break; + case 6: + message.actualStartTime = reader.string(); + break; + case 7: + message.actualEndTime = reader.string(); + break; + case 8: + message.duration = reader.int32(); + break; + case 9: + const entry9 = CreateChallengeInput_Phase_PhaseCriteriaEntry.decode(reader, reader.uint32()); + if (entry9.value !== undefined) { + message.phaseCriteria[entry9.key] = entry9.value; + } + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateChallengeInput_Phase { + return { + phaseTypeId: isSet(object.phaseTypeId) ? Number(object.phaseTypeId) : 0, + phaseStatusId: isSet(object.phaseStatusId) ? Number(object.phaseStatusId) : 0, + fixedStartTime: isSet(object.fixedStartTime) ? String(object.fixedStartTime) : undefined, + scheduledStartTime: isSet(object.scheduledStartTime) ? String(object.scheduledStartTime) : "", + scheduledEndTime: isSet(object.scheduledEndTime) ? String(object.scheduledEndTime) : "", + actualStartTime: isSet(object.actualStartTime) ? String(object.actualStartTime) : undefined, + actualEndTime: isSet(object.actualEndTime) ? String(object.actualEndTime) : undefined, + duration: isSet(object.duration) ? Number(object.duration) : 0, + phaseCriteria: isObject(object.phaseCriteria) + ? Object.entries(object.phaseCriteria).reduce<{ [key: number]: string }>((acc, [key, value]) => { + acc[Number(key)] = String(value); + return acc; + }, {}) + : {}, + }; + }, + + toJSON(message: CreateChallengeInput_Phase): unknown { + const obj: any = {}; + message.phaseTypeId !== undefined && (obj.phaseTypeId = Math.round(message.phaseTypeId)); + message.phaseStatusId !== undefined && (obj.phaseStatusId = Math.round(message.phaseStatusId)); + message.fixedStartTime !== undefined && (obj.fixedStartTime = message.fixedStartTime); + message.scheduledStartTime !== undefined && (obj.scheduledStartTime = message.scheduledStartTime); + message.scheduledEndTime !== undefined && (obj.scheduledEndTime = message.scheduledEndTime); + message.actualStartTime !== undefined && (obj.actualStartTime = message.actualStartTime); + message.actualEndTime !== undefined && (obj.actualEndTime = message.actualEndTime); + message.duration !== undefined && (obj.duration = Math.round(message.duration)); + obj.phaseCriteria = {}; + if (message.phaseCriteria) { + Object.entries(message.phaseCriteria).forEach(([k, v]) => { + obj.phaseCriteria[k] = v; + }); + } + return obj; + }, + + create, I>>(base?: I): CreateChallengeInput_Phase { + return CreateChallengeInput_Phase.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateChallengeInput_Phase { + const message = createBaseCreateChallengeInput_Phase(); + message.phaseTypeId = object.phaseTypeId ?? 0; + message.phaseStatusId = object.phaseStatusId ?? 0; + message.fixedStartTime = object.fixedStartTime ?? undefined; + message.scheduledStartTime = object.scheduledStartTime ?? ""; + message.scheduledEndTime = object.scheduledEndTime ?? ""; + message.actualStartTime = object.actualStartTime ?? undefined; + message.actualEndTime = object.actualEndTime ?? undefined; + message.duration = object.duration ?? 0; + message.phaseCriteria = Object.entries(object.phaseCriteria ?? {}).reduce<{ [key: number]: string }>( + (acc, [key, value]) => { + if (value !== undefined) { + acc[Number(key)] = String(value); + } + return acc; + }, + {}, + ); + return message; + }, +}; + +function createBaseCreateChallengeInput_Phase_PhaseCriteriaEntry(): CreateChallengeInput_Phase_PhaseCriteriaEntry { + return { key: 0, value: "" }; +} + +export const CreateChallengeInput_Phase_PhaseCriteriaEntry = { + encode(message: CreateChallengeInput_Phase_PhaseCriteriaEntry, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.key !== 0) { + writer.uint32(8).sint32(message.key); + } + if (message.value !== "") { + writer.uint32(18).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateChallengeInput_Phase_PhaseCriteriaEntry { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateChallengeInput_Phase_PhaseCriteriaEntry(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.sint32(); + break; + case 2: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateChallengeInput_Phase_PhaseCriteriaEntry { + return { key: isSet(object.key) ? Number(object.key) : 0, value: isSet(object.value) ? String(object.value) : "" }; + }, + + toJSON(message: CreateChallengeInput_Phase_PhaseCriteriaEntry): unknown { + const obj: any = {}; + message.key !== undefined && (obj.key = Math.round(message.key)); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + create, I>>( + base?: I, + ): CreateChallengeInput_Phase_PhaseCriteriaEntry { + return CreateChallengeInput_Phase_PhaseCriteriaEntry.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): CreateChallengeInput_Phase_PhaseCriteriaEntry { + const message = createBaseCreateChallengeInput_Phase_PhaseCriteriaEntry(); + message.key = object.key ?? 0; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseUpdateChallengeInput(): UpdateChallengeInput { + return { projectId: 0, projectStatusId: 0 }; +} + +export const UpdateChallengeInput = { + encode(message: UpdateChallengeInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.projectStatusId !== 0) { + writer.uint32(16).int32(message.projectStatusId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateChallengeInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateChallengeInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.projectStatusId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateChallengeInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + projectStatusId: isSet(object.projectStatusId) ? Number(object.projectStatusId) : 0, + }; + }, + + toJSON(message: UpdateChallengeInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.projectStatusId !== undefined && (obj.projectStatusId = Math.round(message.projectStatusId)); + return obj; + }, + + create, I>>(base?: I): UpdateChallengeInput { + return UpdateChallengeInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UpdateChallengeInput { + const message = createBaseUpdateChallengeInput(); + message.projectId = object.projectId ?? 0; + message.projectStatusId = object.projectStatusId ?? 0; + return message; + }, +}; + +function createBaseCloseChallengeInput(): CloseChallengeInput { + return { projectId: 0, winnerId: 0 }; +} + +export const CloseChallengeInput = { + encode(message: CloseChallengeInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.winnerId !== 0) { + writer.uint32(16).int32(message.winnerId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CloseChallengeInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCloseChallengeInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.winnerId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CloseChallengeInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + winnerId: isSet(object.winnerId) ? Number(object.winnerId) : 0, + }; + }, + + toJSON(message: CloseChallengeInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.winnerId !== undefined && (obj.winnerId = Math.round(message.winnerId)); + return obj; + }, + + create, I>>(base?: I): CloseChallengeInput { + return CloseChallengeInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CloseChallengeInput { + const message = createBaseCloseChallengeInput(); + message.projectId = object.projectId ?? 0; + message.winnerId = object.winnerId ?? 0; + return message; + }, +}; + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/models/domain-layer/legacy/challenge_payment.ts b/src/models/domain-layer/legacy/challenge_payment.ts index 3c54c8f..01bc45c 100644 --- a/src/models/domain-layer/legacy/challenge_payment.ts +++ b/src/models/domain-layer/legacy/challenge_payment.ts @@ -3,24 +3,55 @@ import Long from "long"; import _m0 from "protobufjs/minimal"; export interface LegacyChallengePayment { - place: number; - prizeId: number; - projectId: number; - prizeTypeId: number; - prizeAmount: number; + projectPaymentId: number; + projectPaymentTypeId: number; + resourceId: number; + submissionId: number; + amount: number; + pactsPaymentId: number; createUser: number; createDate: number; modifyUser: number; modifyDate: number; } +export interface LegacyChallengePaymentList { + projectPayments: LegacyChallengePayment[]; +} + +export interface GetLegacyChallengePaymentInput { + resourceId: number; + projectPaymentTypeId: number; +} + +export interface CreateLegacyChallengePaymentInput { + projectPaymentId?: number | undefined; + projectPaymentTypeId: number; + resourceId: number; + submissionId?: number | undefined; + amount: number; + pactsPaymentId?: number | undefined; +} + +export interface UpdateLegacyChallengePaymentInput { + resourceId: number; + projectPaymentTypeId: number; + amount: number; +} + +export interface DeleteLegacyChallengePaymentInput { + resourceId: number; + projectPaymentTypeId: number; +} + function createBaseLegacyChallengePayment(): LegacyChallengePayment { return { - place: 0, - prizeId: 0, - projectId: 0, - prizeTypeId: 0, - prizeAmount: 0, + projectPaymentId: 0, + projectPaymentTypeId: 0, + resourceId: 0, + submissionId: 0, + amount: 0, + pactsPaymentId: 0, createUser: 0, createDate: 0, modifyUser: 0, @@ -30,32 +61,35 @@ function createBaseLegacyChallengePayment(): LegacyChallengePayment { export const LegacyChallengePayment = { encode(message: LegacyChallengePayment, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.place !== 0) { - writer.uint32(8).int32(message.place); + if (message.projectPaymentId !== 0) { + writer.uint32(8).int32(message.projectPaymentId); + } + if (message.projectPaymentTypeId !== 0) { + writer.uint32(16).int32(message.projectPaymentTypeId); } - if (message.prizeId !== 0) { - writer.uint32(16).int32(message.prizeId); + if (message.resourceId !== 0) { + writer.uint32(24).int32(message.resourceId); } - if (message.projectId !== 0) { - writer.uint32(24).int32(message.projectId); + if (message.submissionId !== 0) { + writer.uint32(32).int32(message.submissionId); } - if (message.prizeTypeId !== 0) { - writer.uint32(32).int32(message.prizeTypeId); + if (message.amount !== 0) { + writer.uint32(45).float(message.amount); } - if (message.prizeAmount !== 0) { - writer.uint32(45).float(message.prizeAmount); + if (message.pactsPaymentId !== 0) { + writer.uint32(48).int32(message.pactsPaymentId); } if (message.createUser !== 0) { - writer.uint32(48).int32(message.createUser); + writer.uint32(56).int32(message.createUser); } if (message.createDate !== 0) { - writer.uint32(56).int64(message.createDate); + writer.uint32(64).int64(message.createDate); } if (message.modifyUser !== 0) { - writer.uint32(64).int32(message.modifyUser); + writer.uint32(72).int32(message.modifyUser); } if (message.modifyDate !== 0) { - writer.uint32(72).int64(message.modifyDate); + writer.uint32(80).int64(message.modifyDate); } return writer; }, @@ -68,30 +102,33 @@ export const LegacyChallengePayment = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.place = reader.int32(); + message.projectPaymentId = reader.int32(); break; case 2: - message.prizeId = reader.int32(); + message.projectPaymentTypeId = reader.int32(); break; case 3: - message.projectId = reader.int32(); + message.resourceId = reader.int32(); break; case 4: - message.prizeTypeId = reader.int32(); + message.submissionId = reader.int32(); break; case 5: - message.prizeAmount = reader.float(); + message.amount = reader.float(); break; case 6: - message.createUser = reader.int32(); + message.pactsPaymentId = reader.int32(); break; case 7: - message.createDate = longToNumber(reader.int64() as Long); + message.createUser = reader.int32(); break; case 8: - message.modifyUser = reader.int32(); + message.createDate = longToNumber(reader.int64() as Long); break; case 9: + message.modifyUser = reader.int32(); + break; + case 10: message.modifyDate = longToNumber(reader.int64() as Long); break; default: @@ -104,11 +141,12 @@ export const LegacyChallengePayment = { fromJSON(object: any): LegacyChallengePayment { return { - place: isSet(object.place) ? Number(object.place) : 0, - prizeId: isSet(object.prizeId) ? Number(object.prizeId) : 0, - projectId: isSet(object.projectId) ? Number(object.projectId) : 0, - prizeTypeId: isSet(object.prizeTypeId) ? Number(object.prizeTypeId) : 0, - prizeAmount: isSet(object.prizeAmount) ? Number(object.prizeAmount) : 0, + projectPaymentId: isSet(object.projectPaymentId) ? Number(object.projectPaymentId) : 0, + projectPaymentTypeId: isSet(object.projectPaymentTypeId) ? Number(object.projectPaymentTypeId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + amount: isSet(object.amount) ? Number(object.amount) : 0, + pactsPaymentId: isSet(object.pactsPaymentId) ? Number(object.pactsPaymentId) : 0, createUser: isSet(object.createUser) ? Number(object.createUser) : 0, createDate: isSet(object.createDate) ? Number(object.createDate) : 0, modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, @@ -118,11 +156,12 @@ export const LegacyChallengePayment = { toJSON(message: LegacyChallengePayment): unknown { const obj: any = {}; - message.place !== undefined && (obj.place = Math.round(message.place)); - message.prizeId !== undefined && (obj.prizeId = Math.round(message.prizeId)); - message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); - message.prizeTypeId !== undefined && (obj.prizeTypeId = Math.round(message.prizeTypeId)); - message.prizeAmount !== undefined && (obj.prizeAmount = message.prizeAmount); + message.projectPaymentId !== undefined && (obj.projectPaymentId = Math.round(message.projectPaymentId)); + message.projectPaymentTypeId !== undefined && (obj.projectPaymentTypeId = Math.round(message.projectPaymentTypeId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.amount !== undefined && (obj.amount = message.amount); + message.pactsPaymentId !== undefined && (obj.pactsPaymentId = Math.round(message.pactsPaymentId)); message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); @@ -136,11 +175,12 @@ export const LegacyChallengePayment = { fromPartial, I>>(object: I): LegacyChallengePayment { const message = createBaseLegacyChallengePayment(); - message.place = object.place ?? 0; - message.prizeId = object.prizeId ?? 0; - message.projectId = object.projectId ?? 0; - message.prizeTypeId = object.prizeTypeId ?? 0; - message.prizeAmount = object.prizeAmount ?? 0; + message.projectPaymentId = object.projectPaymentId ?? 0; + message.projectPaymentTypeId = object.projectPaymentTypeId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.submissionId = object.submissionId ?? 0; + message.amount = object.amount ?? 0; + message.pactsPaymentId = object.pactsPaymentId ?? 0; message.createUser = object.createUser ?? 0; message.createDate = object.createDate ?? 0; message.modifyUser = object.modifyUser ?? 0; @@ -149,6 +189,379 @@ export const LegacyChallengePayment = { }, }; +function createBaseLegacyChallengePaymentList(): LegacyChallengePaymentList { + return { projectPayments: [] }; +} + +export const LegacyChallengePaymentList = { + encode(message: LegacyChallengePaymentList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.projectPayments) { + LegacyChallengePayment.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LegacyChallengePaymentList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLegacyChallengePaymentList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPayments.push(LegacyChallengePayment.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LegacyChallengePaymentList { + return { + projectPayments: Array.isArray(object?.projectPayments) + ? object.projectPayments.map((e: any) => LegacyChallengePayment.fromJSON(e)) + : [], + }; + }, + + toJSON(message: LegacyChallengePaymentList): unknown { + const obj: any = {}; + if (message.projectPayments) { + obj.projectPayments = message.projectPayments.map((e) => e ? LegacyChallengePayment.toJSON(e) : undefined); + } else { + obj.projectPayments = []; + } + return obj; + }, + + create, I>>(base?: I): LegacyChallengePaymentList { + return LegacyChallengePaymentList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): LegacyChallengePaymentList { + const message = createBaseLegacyChallengePaymentList(); + message.projectPayments = object.projectPayments?.map((e) => LegacyChallengePayment.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGetLegacyChallengePaymentInput(): GetLegacyChallengePaymentInput { + return { resourceId: 0, projectPaymentTypeId: 0 }; +} + +export const GetLegacyChallengePaymentInput = { + encode(message: GetLegacyChallengePaymentInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.projectPaymentTypeId !== 0) { + writer.uint32(16).int32(message.projectPaymentTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetLegacyChallengePaymentInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetLegacyChallengePaymentInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.projectPaymentTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetLegacyChallengePaymentInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + projectPaymentTypeId: isSet(object.projectPaymentTypeId) ? Number(object.projectPaymentTypeId) : 0, + }; + }, + + toJSON(message: GetLegacyChallengePaymentInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.projectPaymentTypeId !== undefined && (obj.projectPaymentTypeId = Math.round(message.projectPaymentTypeId)); + return obj; + }, + + create, I>>(base?: I): GetLegacyChallengePaymentInput { + return GetLegacyChallengePaymentInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): GetLegacyChallengePaymentInput { + const message = createBaseGetLegacyChallengePaymentInput(); + message.resourceId = object.resourceId ?? 0; + message.projectPaymentTypeId = object.projectPaymentTypeId ?? 0; + return message; + }, +}; + +function createBaseCreateLegacyChallengePaymentInput(): CreateLegacyChallengePaymentInput { + return { + projectPaymentId: undefined, + projectPaymentTypeId: 0, + resourceId: 0, + submissionId: undefined, + amount: 0, + pactsPaymentId: undefined, + }; +} + +export const CreateLegacyChallengePaymentInput = { + encode(message: CreateLegacyChallengePaymentInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectPaymentId !== undefined) { + writer.uint32(8).int32(message.projectPaymentId); + } + if (message.projectPaymentTypeId !== 0) { + writer.uint32(16).int32(message.projectPaymentTypeId); + } + if (message.resourceId !== 0) { + writer.uint32(24).int32(message.resourceId); + } + if (message.submissionId !== undefined) { + writer.uint32(32).int32(message.submissionId); + } + if (message.amount !== 0) { + writer.uint32(45).float(message.amount); + } + if (message.pactsPaymentId !== undefined) { + writer.uint32(48).int32(message.pactsPaymentId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateLegacyChallengePaymentInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateLegacyChallengePaymentInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPaymentId = reader.int32(); + break; + case 2: + message.projectPaymentTypeId = reader.int32(); + break; + case 3: + message.resourceId = reader.int32(); + break; + case 4: + message.submissionId = reader.int32(); + break; + case 5: + message.amount = reader.float(); + break; + case 6: + message.pactsPaymentId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateLegacyChallengePaymentInput { + return { + projectPaymentId: isSet(object.projectPaymentId) ? Number(object.projectPaymentId) : undefined, + projectPaymentTypeId: isSet(object.projectPaymentTypeId) ? Number(object.projectPaymentTypeId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : undefined, + amount: isSet(object.amount) ? Number(object.amount) : 0, + pactsPaymentId: isSet(object.pactsPaymentId) ? Number(object.pactsPaymentId) : undefined, + }; + }, + + toJSON(message: CreateLegacyChallengePaymentInput): unknown { + const obj: any = {}; + message.projectPaymentId !== undefined && (obj.projectPaymentId = Math.round(message.projectPaymentId)); + message.projectPaymentTypeId !== undefined && (obj.projectPaymentTypeId = Math.round(message.projectPaymentTypeId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.amount !== undefined && (obj.amount = message.amount); + message.pactsPaymentId !== undefined && (obj.pactsPaymentId = Math.round(message.pactsPaymentId)); + return obj; + }, + + create, I>>( + base?: I, + ): CreateLegacyChallengePaymentInput { + return CreateLegacyChallengePaymentInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): CreateLegacyChallengePaymentInput { + const message = createBaseCreateLegacyChallengePaymentInput(); + message.projectPaymentId = object.projectPaymentId ?? undefined; + message.projectPaymentTypeId = object.projectPaymentTypeId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.submissionId = object.submissionId ?? undefined; + message.amount = object.amount ?? 0; + message.pactsPaymentId = object.pactsPaymentId ?? undefined; + return message; + }, +}; + +function createBaseUpdateLegacyChallengePaymentInput(): UpdateLegacyChallengePaymentInput { + return { resourceId: 0, projectPaymentTypeId: 0, amount: 0 }; +} + +export const UpdateLegacyChallengePaymentInput = { + encode(message: UpdateLegacyChallengePaymentInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.projectPaymentTypeId !== 0) { + writer.uint32(16).int32(message.projectPaymentTypeId); + } + if (message.amount !== 0) { + writer.uint32(29).float(message.amount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateLegacyChallengePaymentInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateLegacyChallengePaymentInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.projectPaymentTypeId = reader.int32(); + break; + case 3: + message.amount = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateLegacyChallengePaymentInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + projectPaymentTypeId: isSet(object.projectPaymentTypeId) ? Number(object.projectPaymentTypeId) : 0, + amount: isSet(object.amount) ? Number(object.amount) : 0, + }; + }, + + toJSON(message: UpdateLegacyChallengePaymentInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.projectPaymentTypeId !== undefined && (obj.projectPaymentTypeId = Math.round(message.projectPaymentTypeId)); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + create, I>>( + base?: I, + ): UpdateLegacyChallengePaymentInput { + return UpdateLegacyChallengePaymentInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): UpdateLegacyChallengePaymentInput { + const message = createBaseUpdateLegacyChallengePaymentInput(); + message.resourceId = object.resourceId ?? 0; + message.projectPaymentTypeId = object.projectPaymentTypeId ?? 0; + message.amount = object.amount ?? 0; + return message; + }, +}; + +function createBaseDeleteLegacyChallengePaymentInput(): DeleteLegacyChallengePaymentInput { + return { resourceId: 0, projectPaymentTypeId: 0 }; +} + +export const DeleteLegacyChallengePaymentInput = { + encode(message: DeleteLegacyChallengePaymentInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.projectPaymentTypeId !== 0) { + writer.uint32(16).int32(message.projectPaymentTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteLegacyChallengePaymentInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteLegacyChallengePaymentInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.projectPaymentTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteLegacyChallengePaymentInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + projectPaymentTypeId: isSet(object.projectPaymentTypeId) ? Number(object.projectPaymentTypeId) : 0, + }; + }, + + toJSON(message: DeleteLegacyChallengePaymentInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.projectPaymentTypeId !== undefined && (obj.projectPaymentTypeId = Math.round(message.projectPaymentTypeId)); + return obj; + }, + + create, I>>( + base?: I, + ): DeleteLegacyChallengePaymentInput { + return DeleteLegacyChallengePaymentInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): DeleteLegacyChallengePaymentInput { + const message = createBaseDeleteLegacyChallengePaymentInput(); + message.resourceId = object.resourceId ?? 0; + message.projectPaymentTypeId = object.projectPaymentTypeId ?? 0; + return message; + }, +}; + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/models/domain-layer/legacy/group_contest_eligibility.ts b/src/models/domain-layer/legacy/group_contest_eligibility.ts new file mode 100644 index 0000000..e4001a3 --- /dev/null +++ b/src/models/domain-layer/legacy/group_contest_eligibility.ts @@ -0,0 +1,531 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export interface ContestEligibility { + contestEligibilityId: number; + contestId: number; + isStudio: number; +} + +export interface GetContestEligibilityInput { + contestId: number; +} + +export interface ContestEligibilityList { + contestEligibilities: ContestEligibility[]; +} + +export interface DeleteContestEligibilityInput { + contestEligibilityId: number; +} + +export interface GroupContestEligibility { + contestEligibilityId: number; + groupId: number; +} + +export interface GetGroupContestEligibilityInput { + contestEligibilityId: number; +} + +export interface GroupContestEligibilityList { + groupContestEligibilities: GroupContestEligibility[]; +} + +export interface DeleteGroupContestEligibilityInput { + contestEligibilityId: number; + groupId: number; +} + +function createBaseContestEligibility(): ContestEligibility { + return { contestEligibilityId: 0, contestId: 0, isStudio: 0 }; +} + +export const ContestEligibility = { + encode(message: ContestEligibility, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contestEligibilityId !== 0) { + writer.uint32(8).int32(message.contestEligibilityId); + } + if (message.contestId !== 0) { + writer.uint32(16).int32(message.contestId); + } + if (message.isStudio !== 0) { + writer.uint32(24).int32(message.isStudio); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ContestEligibility { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContestEligibility(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestEligibilityId = reader.int32(); + break; + case 2: + message.contestId = reader.int32(); + break; + case 3: + message.isStudio = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ContestEligibility { + return { + contestEligibilityId: isSet(object.contestEligibilityId) ? Number(object.contestEligibilityId) : 0, + contestId: isSet(object.contestId) ? Number(object.contestId) : 0, + isStudio: isSet(object.isStudio) ? Number(object.isStudio) : 0, + }; + }, + + toJSON(message: ContestEligibility): unknown { + const obj: any = {}; + message.contestEligibilityId !== undefined && (obj.contestEligibilityId = Math.round(message.contestEligibilityId)); + message.contestId !== undefined && (obj.contestId = Math.round(message.contestId)); + message.isStudio !== undefined && (obj.isStudio = Math.round(message.isStudio)); + return obj; + }, + + create, I>>(base?: I): ContestEligibility { + return ContestEligibility.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ContestEligibility { + const message = createBaseContestEligibility(); + message.contestEligibilityId = object.contestEligibilityId ?? 0; + message.contestId = object.contestId ?? 0; + message.isStudio = object.isStudio ?? 0; + return message; + }, +}; + +function createBaseGetContestEligibilityInput(): GetContestEligibilityInput { + return { contestId: 0 }; +} + +export const GetContestEligibilityInput = { + encode(message: GetContestEligibilityInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contestId !== 0) { + writer.uint32(8).int32(message.contestId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetContestEligibilityInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetContestEligibilityInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetContestEligibilityInput { + return { contestId: isSet(object.contestId) ? Number(object.contestId) : 0 }; + }, + + toJSON(message: GetContestEligibilityInput): unknown { + const obj: any = {}; + message.contestId !== undefined && (obj.contestId = Math.round(message.contestId)); + return obj; + }, + + create, I>>(base?: I): GetContestEligibilityInput { + return GetContestEligibilityInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetContestEligibilityInput { + const message = createBaseGetContestEligibilityInput(); + message.contestId = object.contestId ?? 0; + return message; + }, +}; + +function createBaseContestEligibilityList(): ContestEligibilityList { + return { contestEligibilities: [] }; +} + +export const ContestEligibilityList = { + encode(message: ContestEligibilityList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.contestEligibilities) { + ContestEligibility.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ContestEligibilityList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseContestEligibilityList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestEligibilities.push(ContestEligibility.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ContestEligibilityList { + return { + contestEligibilities: Array.isArray(object?.contestEligibilities) + ? object.contestEligibilities.map((e: any) => ContestEligibility.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ContestEligibilityList): unknown { + const obj: any = {}; + if (message.contestEligibilities) { + obj.contestEligibilities = message.contestEligibilities.map((e) => e ? ContestEligibility.toJSON(e) : undefined); + } else { + obj.contestEligibilities = []; + } + return obj; + }, + + create, I>>(base?: I): ContestEligibilityList { + return ContestEligibilityList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ContestEligibilityList { + const message = createBaseContestEligibilityList(); + message.contestEligibilities = object.contestEligibilities?.map((e) => ContestEligibility.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDeleteContestEligibilityInput(): DeleteContestEligibilityInput { + return { contestEligibilityId: 0 }; +} + +export const DeleteContestEligibilityInput = { + encode(message: DeleteContestEligibilityInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contestEligibilityId !== 0) { + writer.uint32(8).int32(message.contestEligibilityId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteContestEligibilityInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteContestEligibilityInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestEligibilityId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteContestEligibilityInput { + return { contestEligibilityId: isSet(object.contestEligibilityId) ? Number(object.contestEligibilityId) : 0 }; + }, + + toJSON(message: DeleteContestEligibilityInput): unknown { + const obj: any = {}; + message.contestEligibilityId !== undefined && (obj.contestEligibilityId = Math.round(message.contestEligibilityId)); + return obj; + }, + + create, I>>(base?: I): DeleteContestEligibilityInput { + return DeleteContestEligibilityInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): DeleteContestEligibilityInput { + const message = createBaseDeleteContestEligibilityInput(); + message.contestEligibilityId = object.contestEligibilityId ?? 0; + return message; + }, +}; + +function createBaseGroupContestEligibility(): GroupContestEligibility { + return { contestEligibilityId: 0, groupId: 0 }; +} + +export const GroupContestEligibility = { + encode(message: GroupContestEligibility, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contestEligibilityId !== 0) { + writer.uint32(8).int32(message.contestEligibilityId); + } + if (message.groupId !== 0) { + writer.uint32(16).int32(message.groupId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GroupContestEligibility { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupContestEligibility(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestEligibilityId = reader.int32(); + break; + case 2: + message.groupId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GroupContestEligibility { + return { + contestEligibilityId: isSet(object.contestEligibilityId) ? Number(object.contestEligibilityId) : 0, + groupId: isSet(object.groupId) ? Number(object.groupId) : 0, + }; + }, + + toJSON(message: GroupContestEligibility): unknown { + const obj: any = {}; + message.contestEligibilityId !== undefined && (obj.contestEligibilityId = Math.round(message.contestEligibilityId)); + message.groupId !== undefined && (obj.groupId = Math.round(message.groupId)); + return obj; + }, + + create, I>>(base?: I): GroupContestEligibility { + return GroupContestEligibility.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GroupContestEligibility { + const message = createBaseGroupContestEligibility(); + message.contestEligibilityId = object.contestEligibilityId ?? 0; + message.groupId = object.groupId ?? 0; + return message; + }, +}; + +function createBaseGetGroupContestEligibilityInput(): GetGroupContestEligibilityInput { + return { contestEligibilityId: 0 }; +} + +export const GetGroupContestEligibilityInput = { + encode(message: GetGroupContestEligibilityInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contestEligibilityId !== 0) { + writer.uint32(8).int32(message.contestEligibilityId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetGroupContestEligibilityInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetGroupContestEligibilityInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestEligibilityId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetGroupContestEligibilityInput { + return { contestEligibilityId: isSet(object.contestEligibilityId) ? Number(object.contestEligibilityId) : 0 }; + }, + + toJSON(message: GetGroupContestEligibilityInput): unknown { + const obj: any = {}; + message.contestEligibilityId !== undefined && (obj.contestEligibilityId = Math.round(message.contestEligibilityId)); + return obj; + }, + + create, I>>(base?: I): GetGroupContestEligibilityInput { + return GetGroupContestEligibilityInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): GetGroupContestEligibilityInput { + const message = createBaseGetGroupContestEligibilityInput(); + message.contestEligibilityId = object.contestEligibilityId ?? 0; + return message; + }, +}; + +function createBaseGroupContestEligibilityList(): GroupContestEligibilityList { + return { groupContestEligibilities: [] }; +} + +export const GroupContestEligibilityList = { + encode(message: GroupContestEligibilityList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.groupContestEligibilities) { + GroupContestEligibility.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GroupContestEligibilityList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGroupContestEligibilityList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.groupContestEligibilities.push(GroupContestEligibility.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GroupContestEligibilityList { + return { + groupContestEligibilities: Array.isArray(object?.groupContestEligibilities) + ? object.groupContestEligibilities.map((e: any) => GroupContestEligibility.fromJSON(e)) + : [], + }; + }, + + toJSON(message: GroupContestEligibilityList): unknown { + const obj: any = {}; + if (message.groupContestEligibilities) { + obj.groupContestEligibilities = message.groupContestEligibilities.map((e) => + e ? GroupContestEligibility.toJSON(e) : undefined + ); + } else { + obj.groupContestEligibilities = []; + } + return obj; + }, + + create, I>>(base?: I): GroupContestEligibilityList { + return GroupContestEligibilityList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GroupContestEligibilityList { + const message = createBaseGroupContestEligibilityList(); + message.groupContestEligibilities = + object.groupContestEligibilities?.map((e) => GroupContestEligibility.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDeleteGroupContestEligibilityInput(): DeleteGroupContestEligibilityInput { + return { contestEligibilityId: 0, groupId: 0 }; +} + +export const DeleteGroupContestEligibilityInput = { + encode(message: DeleteGroupContestEligibilityInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.contestEligibilityId !== 0) { + writer.uint32(8).int32(message.contestEligibilityId); + } + if (message.groupId !== 0) { + writer.uint32(16).int32(message.groupId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteGroupContestEligibilityInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteGroupContestEligibilityInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.contestEligibilityId = reader.int32(); + break; + case 2: + message.groupId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteGroupContestEligibilityInput { + return { + contestEligibilityId: isSet(object.contestEligibilityId) ? Number(object.contestEligibilityId) : 0, + groupId: isSet(object.groupId) ? Number(object.groupId) : 0, + }; + }, + + toJSON(message: DeleteGroupContestEligibilityInput): unknown { + const obj: any = {}; + message.contestEligibilityId !== undefined && (obj.contestEligibilityId = Math.round(message.contestEligibilityId)); + message.groupId !== undefined && (obj.groupId = Math.round(message.groupId)); + return obj; + }, + + create, I>>( + base?: I, + ): DeleteGroupContestEligibilityInput { + return DeleteGroupContestEligibilityInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): DeleteGroupContestEligibilityInput { + const message = createBaseDeleteGroupContestEligibilityInput(); + message.contestEligibilityId = object.contestEligibilityId ?? 0; + message.groupId = object.groupId ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/notification.ts b/src/models/domain-layer/legacy/notification.ts new file mode 100644 index 0000000..d9f6254 --- /dev/null +++ b/src/models/domain-layer/legacy/notification.ts @@ -0,0 +1,292 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export interface Notification { + notificationTypeId: number; + externalRefId: number; + projectId: number; +} + +export interface NotificationList { + notifications: Notification[]; +} + +export interface GetNotificationsInput { + externalRefId: number; + projectId: number; +} + +export interface DeleteNotificationsInput { + externalRefId: number; + projectId: number; +} + +function createBaseNotification(): Notification { + return { notificationTypeId: 0, externalRefId: 0, projectId: 0 }; +} + +export const Notification = { + encode(message: Notification, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.notificationTypeId !== 0) { + writer.uint32(8).int32(message.notificationTypeId); + } + if (message.externalRefId !== 0) { + writer.uint32(16).int32(message.externalRefId); + } + if (message.projectId !== 0) { + writer.uint32(24).int32(message.projectId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Notification { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNotification(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notificationTypeId = reader.int32(); + break; + case 2: + message.externalRefId = reader.int32(); + break; + case 3: + message.projectId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Notification { + return { + notificationTypeId: isSet(object.notificationTypeId) ? Number(object.notificationTypeId) : 0, + externalRefId: isSet(object.externalRefId) ? Number(object.externalRefId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + }; + }, + + toJSON(message: Notification): unknown { + const obj: any = {}; + message.notificationTypeId !== undefined && (obj.notificationTypeId = Math.round(message.notificationTypeId)); + message.externalRefId !== undefined && (obj.externalRefId = Math.round(message.externalRefId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + return obj; + }, + + create, I>>(base?: I): Notification { + return Notification.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Notification { + const message = createBaseNotification(); + message.notificationTypeId = object.notificationTypeId ?? 0; + message.externalRefId = object.externalRefId ?? 0; + message.projectId = object.projectId ?? 0; + return message; + }, +}; + +function createBaseNotificationList(): NotificationList { + return { notifications: [] }; +} + +export const NotificationList = { + encode(message: NotificationList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.notifications) { + Notification.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): NotificationList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseNotificationList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.notifications.push(Notification.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): NotificationList { + return { + notifications: Array.isArray(object?.notifications) + ? object.notifications.map((e: any) => Notification.fromJSON(e)) + : [], + }; + }, + + toJSON(message: NotificationList): unknown { + const obj: any = {}; + if (message.notifications) { + obj.notifications = message.notifications.map((e) => e ? Notification.toJSON(e) : undefined); + } else { + obj.notifications = []; + } + return obj; + }, + + create, I>>(base?: I): NotificationList { + return NotificationList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): NotificationList { + const message = createBaseNotificationList(); + message.notifications = object.notifications?.map((e) => Notification.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGetNotificationsInput(): GetNotificationsInput { + return { externalRefId: 0, projectId: 0 }; +} + +export const GetNotificationsInput = { + encode(message: GetNotificationsInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.externalRefId !== 0) { + writer.uint32(8).int32(message.externalRefId); + } + if (message.projectId !== 0) { + writer.uint32(16).int32(message.projectId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetNotificationsInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetNotificationsInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.externalRefId = reader.int32(); + break; + case 2: + message.projectId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetNotificationsInput { + return { + externalRefId: isSet(object.externalRefId) ? Number(object.externalRefId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + }; + }, + + toJSON(message: GetNotificationsInput): unknown { + const obj: any = {}; + message.externalRefId !== undefined && (obj.externalRefId = Math.round(message.externalRefId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + return obj; + }, + + create, I>>(base?: I): GetNotificationsInput { + return GetNotificationsInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetNotificationsInput { + const message = createBaseGetNotificationsInput(); + message.externalRefId = object.externalRefId ?? 0; + message.projectId = object.projectId ?? 0; + return message; + }, +}; + +function createBaseDeleteNotificationsInput(): DeleteNotificationsInput { + return { externalRefId: 0, projectId: 0 }; +} + +export const DeleteNotificationsInput = { + encode(message: DeleteNotificationsInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.externalRefId !== 0) { + writer.uint32(8).int32(message.externalRefId); + } + if (message.projectId !== 0) { + writer.uint32(16).int32(message.projectId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteNotificationsInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteNotificationsInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.externalRefId = reader.int32(); + break; + case 2: + message.projectId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteNotificationsInput { + return { + externalRefId: isSet(object.externalRefId) ? Number(object.externalRefId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + }; + }, + + toJSON(message: DeleteNotificationsInput): unknown { + const obj: any = {}; + message.externalRefId !== undefined && (obj.externalRefId = Math.round(message.externalRefId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + return obj; + }, + + create, I>>(base?: I): DeleteNotificationsInput { + return DeleteNotificationsInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeleteNotificationsInput { + const message = createBaseDeleteNotificationsInput(); + message.externalRefId = object.externalRefId ?? 0; + message.projectId = object.projectId ?? 0; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/payment.ts b/src/models/domain-layer/legacy/payment.ts new file mode 100644 index 0000000..62cdb70 --- /dev/null +++ b/src/models/domain-layer/legacy/payment.ts @@ -0,0 +1,1134 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export interface ProjectPayment { + projectPaymentId: number; + projectPaymentTypeId: number; + resourceId: number; + submissionId: number; + amount: number; + pactsPaymentId: number; + createUser: number; + createDate: number; + modifyUser: number; + modifyDate: number; +} + +export interface ProjectPaymentList { + projectPayments: ProjectPayment[]; +} + +export interface GetProjectPaymentsInput { + resourceId: number; + projectPaymentTypeId: number; +} + +export interface CreateProjectPaymentsInput { + projectPaymentId: number; + projectPaymentTypeId: number; + resourceId: number; + submissionId: number; + amount: number; + pactsPaymentId: number; +} + +export interface UpdateProjectPaymentsInput { + resourceId: number; + projectPaymentTypeId: number; + amount: number; +} + +export interface DeleteProjectPaymentsInput { + resourceId: number; + projectPaymentTypeId: number; +} + +export interface Prize { + prizeId: number; + projectId: number; + place: number; + prizeAmount: number; + prizeTypeId: number; + numberOfSubmissions: number; + createUser: number; + createDate: number; + modifyUser: number; + modifyDate: number; +} + +export interface PrizeList { + prizes: Prize[]; +} + +export interface GetPrizesInput { + projectId: number; + prizeTypeId: number; +} + +export interface CreatePrizeInput { + prizeId: number; + projectId: number; + place: number; + prizeAmount: number; + prizeTypeId: number; + numberOfSubmissions: number; +} + +export interface UpdatePrizeInput { + prizeId: number; + projectId: number; + numberOfSubmissions: number; + prizeAmount: number; +} + +export interface DeletePrizeInput { + prizeId: number; + projectId: number; +} + +function createBaseProjectPayment(): ProjectPayment { + return { + projectPaymentId: 0, + projectPaymentTypeId: 0, + resourceId: 0, + submissionId: 0, + amount: 0, + pactsPaymentId: 0, + createUser: 0, + createDate: 0, + modifyUser: 0, + modifyDate: 0, + }; +} + +export const ProjectPayment = { + encode(message: ProjectPayment, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectPaymentId !== 0) { + writer.uint32(8).int32(message.projectPaymentId); + } + if (message.projectPaymentTypeId !== 0) { + writer.uint32(16).int32(message.projectPaymentTypeId); + } + if (message.resourceId !== 0) { + writer.uint32(24).int32(message.resourceId); + } + if (message.submissionId !== 0) { + writer.uint32(32).int32(message.submissionId); + } + if (message.amount !== 0) { + writer.uint32(45).float(message.amount); + } + if (message.pactsPaymentId !== 0) { + writer.uint32(48).int32(message.pactsPaymentId); + } + if (message.createUser !== 0) { + writer.uint32(56).int32(message.createUser); + } + if (message.createDate !== 0) { + writer.uint32(64).int64(message.createDate); + } + if (message.modifyUser !== 0) { + writer.uint32(72).int32(message.modifyUser); + } + if (message.modifyDate !== 0) { + writer.uint32(80).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProjectPayment { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProjectPayment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPaymentId = reader.int32(); + break; + case 2: + message.projectPaymentTypeId = reader.int32(); + break; + case 3: + message.resourceId = reader.int32(); + break; + case 4: + message.submissionId = reader.int32(); + break; + case 5: + message.amount = reader.float(); + break; + case 6: + message.pactsPaymentId = reader.int32(); + break; + case 7: + message.createUser = reader.int32(); + break; + case 8: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 9: + message.modifyUser = reader.int32(); + break; + case 10: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProjectPayment { + return { + projectPaymentId: isSet(object.projectPaymentId) ? Number(object.projectPaymentId) : 0, + projectPaymentTypeId: isSet(object.projectPaymentTypeId) ? Number(object.projectPaymentTypeId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + amount: isSet(object.amount) ? Number(object.amount) : 0, + pactsPaymentId: isSet(object.pactsPaymentId) ? Number(object.pactsPaymentId) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + }; + }, + + toJSON(message: ProjectPayment): unknown { + const obj: any = {}; + message.projectPaymentId !== undefined && (obj.projectPaymentId = Math.round(message.projectPaymentId)); + message.projectPaymentTypeId !== undefined && (obj.projectPaymentTypeId = Math.round(message.projectPaymentTypeId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.amount !== undefined && (obj.amount = message.amount); + message.pactsPaymentId !== undefined && (obj.pactsPaymentId = Math.round(message.pactsPaymentId)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): ProjectPayment { + return ProjectPayment.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ProjectPayment { + const message = createBaseProjectPayment(); + message.projectPaymentId = object.projectPaymentId ?? 0; + message.projectPaymentTypeId = object.projectPaymentTypeId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.submissionId = object.submissionId ?? 0; + message.amount = object.amount ?? 0; + message.pactsPaymentId = object.pactsPaymentId ?? 0; + message.createUser = object.createUser ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.modifyDate = object.modifyDate ?? 0; + return message; + }, +}; + +function createBaseProjectPaymentList(): ProjectPaymentList { + return { projectPayments: [] }; +} + +export const ProjectPaymentList = { + encode(message: ProjectPaymentList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.projectPayments) { + ProjectPayment.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProjectPaymentList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProjectPaymentList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPayments.push(ProjectPayment.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProjectPaymentList { + return { + projectPayments: Array.isArray(object?.projectPayments) + ? object.projectPayments.map((e: any) => ProjectPayment.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ProjectPaymentList): unknown { + const obj: any = {}; + if (message.projectPayments) { + obj.projectPayments = message.projectPayments.map((e) => e ? ProjectPayment.toJSON(e) : undefined); + } else { + obj.projectPayments = []; + } + return obj; + }, + + create, I>>(base?: I): ProjectPaymentList { + return ProjectPaymentList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ProjectPaymentList { + const message = createBaseProjectPaymentList(); + message.projectPayments = object.projectPayments?.map((e) => ProjectPayment.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGetProjectPaymentsInput(): GetProjectPaymentsInput { + return { resourceId: 0, projectPaymentTypeId: 0 }; +} + +export const GetProjectPaymentsInput = { + encode(message: GetProjectPaymentsInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.projectPaymentTypeId !== 0) { + writer.uint32(16).int32(message.projectPaymentTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetProjectPaymentsInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetProjectPaymentsInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.projectPaymentTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetProjectPaymentsInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + projectPaymentTypeId: isSet(object.projectPaymentTypeId) ? Number(object.projectPaymentTypeId) : 0, + }; + }, + + toJSON(message: GetProjectPaymentsInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.projectPaymentTypeId !== undefined && (obj.projectPaymentTypeId = Math.round(message.projectPaymentTypeId)); + return obj; + }, + + create, I>>(base?: I): GetProjectPaymentsInput { + return GetProjectPaymentsInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetProjectPaymentsInput { + const message = createBaseGetProjectPaymentsInput(); + message.resourceId = object.resourceId ?? 0; + message.projectPaymentTypeId = object.projectPaymentTypeId ?? 0; + return message; + }, +}; + +function createBaseCreateProjectPaymentsInput(): CreateProjectPaymentsInput { + return { projectPaymentId: 0, projectPaymentTypeId: 0, resourceId: 0, submissionId: 0, amount: 0, pactsPaymentId: 0 }; +} + +export const CreateProjectPaymentsInput = { + encode(message: CreateProjectPaymentsInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectPaymentId !== 0) { + writer.uint32(8).int32(message.projectPaymentId); + } + if (message.projectPaymentTypeId !== 0) { + writer.uint32(16).int32(message.projectPaymentTypeId); + } + if (message.resourceId !== 0) { + writer.uint32(24).int32(message.resourceId); + } + if (message.submissionId !== 0) { + writer.uint32(32).int32(message.submissionId); + } + if (message.amount !== 0) { + writer.uint32(45).float(message.amount); + } + if (message.pactsPaymentId !== 0) { + writer.uint32(48).int32(message.pactsPaymentId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateProjectPaymentsInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateProjectPaymentsInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPaymentId = reader.int32(); + break; + case 2: + message.projectPaymentTypeId = reader.int32(); + break; + case 3: + message.resourceId = reader.int32(); + break; + case 4: + message.submissionId = reader.int32(); + break; + case 5: + message.amount = reader.float(); + break; + case 6: + message.pactsPaymentId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateProjectPaymentsInput { + return { + projectPaymentId: isSet(object.projectPaymentId) ? Number(object.projectPaymentId) : 0, + projectPaymentTypeId: isSet(object.projectPaymentTypeId) ? Number(object.projectPaymentTypeId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + amount: isSet(object.amount) ? Number(object.amount) : 0, + pactsPaymentId: isSet(object.pactsPaymentId) ? Number(object.pactsPaymentId) : 0, + }; + }, + + toJSON(message: CreateProjectPaymentsInput): unknown { + const obj: any = {}; + message.projectPaymentId !== undefined && (obj.projectPaymentId = Math.round(message.projectPaymentId)); + message.projectPaymentTypeId !== undefined && (obj.projectPaymentTypeId = Math.round(message.projectPaymentTypeId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.amount !== undefined && (obj.amount = message.amount); + message.pactsPaymentId !== undefined && (obj.pactsPaymentId = Math.round(message.pactsPaymentId)); + return obj; + }, + + create, I>>(base?: I): CreateProjectPaymentsInput { + return CreateProjectPaymentsInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateProjectPaymentsInput { + const message = createBaseCreateProjectPaymentsInput(); + message.projectPaymentId = object.projectPaymentId ?? 0; + message.projectPaymentTypeId = object.projectPaymentTypeId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.submissionId = object.submissionId ?? 0; + message.amount = object.amount ?? 0; + message.pactsPaymentId = object.pactsPaymentId ?? 0; + return message; + }, +}; + +function createBaseUpdateProjectPaymentsInput(): UpdateProjectPaymentsInput { + return { resourceId: 0, projectPaymentTypeId: 0, amount: 0 }; +} + +export const UpdateProjectPaymentsInput = { + encode(message: UpdateProjectPaymentsInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.projectPaymentTypeId !== 0) { + writer.uint32(16).int32(message.projectPaymentTypeId); + } + if (message.amount !== 0) { + writer.uint32(29).float(message.amount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateProjectPaymentsInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateProjectPaymentsInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.projectPaymentTypeId = reader.int32(); + break; + case 3: + message.amount = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateProjectPaymentsInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + projectPaymentTypeId: isSet(object.projectPaymentTypeId) ? Number(object.projectPaymentTypeId) : 0, + amount: isSet(object.amount) ? Number(object.amount) : 0, + }; + }, + + toJSON(message: UpdateProjectPaymentsInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.projectPaymentTypeId !== undefined && (obj.projectPaymentTypeId = Math.round(message.projectPaymentTypeId)); + message.amount !== undefined && (obj.amount = message.amount); + return obj; + }, + + create, I>>(base?: I): UpdateProjectPaymentsInput { + return UpdateProjectPaymentsInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UpdateProjectPaymentsInput { + const message = createBaseUpdateProjectPaymentsInput(); + message.resourceId = object.resourceId ?? 0; + message.projectPaymentTypeId = object.projectPaymentTypeId ?? 0; + message.amount = object.amount ?? 0; + return message; + }, +}; + +function createBaseDeleteProjectPaymentsInput(): DeleteProjectPaymentsInput { + return { resourceId: 0, projectPaymentTypeId: 0 }; +} + +export const DeleteProjectPaymentsInput = { + encode(message: DeleteProjectPaymentsInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.projectPaymentTypeId !== 0) { + writer.uint32(16).int32(message.projectPaymentTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteProjectPaymentsInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteProjectPaymentsInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.projectPaymentTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteProjectPaymentsInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + projectPaymentTypeId: isSet(object.projectPaymentTypeId) ? Number(object.projectPaymentTypeId) : 0, + }; + }, + + toJSON(message: DeleteProjectPaymentsInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.projectPaymentTypeId !== undefined && (obj.projectPaymentTypeId = Math.round(message.projectPaymentTypeId)); + return obj; + }, + + create, I>>(base?: I): DeleteProjectPaymentsInput { + return DeleteProjectPaymentsInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeleteProjectPaymentsInput { + const message = createBaseDeleteProjectPaymentsInput(); + message.resourceId = object.resourceId ?? 0; + message.projectPaymentTypeId = object.projectPaymentTypeId ?? 0; + return message; + }, +}; + +function createBasePrize(): Prize { + return { + prizeId: 0, + projectId: 0, + place: 0, + prizeAmount: 0, + prizeTypeId: 0, + numberOfSubmissions: 0, + createUser: 0, + createDate: 0, + modifyUser: 0, + modifyDate: 0, + }; +} + +export const Prize = { + encode(message: Prize, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.prizeId !== 0) { + writer.uint32(8).int32(message.prizeId); + } + if (message.projectId !== 0) { + writer.uint32(16).int32(message.projectId); + } + if (message.place !== 0) { + writer.uint32(24).int32(message.place); + } + if (message.prizeAmount !== 0) { + writer.uint32(37).float(message.prizeAmount); + } + if (message.prizeTypeId !== 0) { + writer.uint32(40).int32(message.prizeTypeId); + } + if (message.numberOfSubmissions !== 0) { + writer.uint32(48).int32(message.numberOfSubmissions); + } + if (message.createUser !== 0) { + writer.uint32(64).int32(message.createUser); + } + if (message.createDate !== 0) { + writer.uint32(72).int64(message.createDate); + } + if (message.modifyUser !== 0) { + writer.uint32(80).int32(message.modifyUser); + } + if (message.modifyDate !== 0) { + writer.uint32(88).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Prize { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrize(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prizeId = reader.int32(); + break; + case 2: + message.projectId = reader.int32(); + break; + case 3: + message.place = reader.int32(); + break; + case 4: + message.prizeAmount = reader.float(); + break; + case 5: + message.prizeTypeId = reader.int32(); + break; + case 6: + message.numberOfSubmissions = reader.int32(); + break; + case 8: + message.createUser = reader.int32(); + break; + case 9: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 10: + message.modifyUser = reader.int32(); + break; + case 11: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Prize { + return { + prizeId: isSet(object.prizeId) ? Number(object.prizeId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + place: isSet(object.place) ? Number(object.place) : 0, + prizeAmount: isSet(object.prizeAmount) ? Number(object.prizeAmount) : 0, + prizeTypeId: isSet(object.prizeTypeId) ? Number(object.prizeTypeId) : 0, + numberOfSubmissions: isSet(object.numberOfSubmissions) ? Number(object.numberOfSubmissions) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + }; + }, + + toJSON(message: Prize): unknown { + const obj: any = {}; + message.prizeId !== undefined && (obj.prizeId = Math.round(message.prizeId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.place !== undefined && (obj.place = Math.round(message.place)); + message.prizeAmount !== undefined && (obj.prizeAmount = message.prizeAmount); + message.prizeTypeId !== undefined && (obj.prizeTypeId = Math.round(message.prizeTypeId)); + message.numberOfSubmissions !== undefined && (obj.numberOfSubmissions = Math.round(message.numberOfSubmissions)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): Prize { + return Prize.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Prize { + const message = createBasePrize(); + message.prizeId = object.prizeId ?? 0; + message.projectId = object.projectId ?? 0; + message.place = object.place ?? 0; + message.prizeAmount = object.prizeAmount ?? 0; + message.prizeTypeId = object.prizeTypeId ?? 0; + message.numberOfSubmissions = object.numberOfSubmissions ?? 0; + message.createUser = object.createUser ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.modifyDate = object.modifyDate ?? 0; + return message; + }, +}; + +function createBasePrizeList(): PrizeList { + return { prizes: [] }; +} + +export const PrizeList = { + encode(message: PrizeList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.prizes) { + Prize.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PrizeList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePrizeList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prizes.push(Prize.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PrizeList { + return { prizes: Array.isArray(object?.prizes) ? object.prizes.map((e: any) => Prize.fromJSON(e)) : [] }; + }, + + toJSON(message: PrizeList): unknown { + const obj: any = {}; + if (message.prizes) { + obj.prizes = message.prizes.map((e) => e ? Prize.toJSON(e) : undefined); + } else { + obj.prizes = []; + } + return obj; + }, + + create, I>>(base?: I): PrizeList { + return PrizeList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): PrizeList { + const message = createBasePrizeList(); + message.prizes = object.prizes?.map((e) => Prize.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGetPrizesInput(): GetPrizesInput { + return { projectId: 0, prizeTypeId: 0 }; +} + +export const GetPrizesInput = { + encode(message: GetPrizesInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.prizeTypeId !== 0) { + writer.uint32(16).int32(message.prizeTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetPrizesInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetPrizesInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.prizeTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetPrizesInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + prizeTypeId: isSet(object.prizeTypeId) ? Number(object.prizeTypeId) : 0, + }; + }, + + toJSON(message: GetPrizesInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.prizeTypeId !== undefined && (obj.prizeTypeId = Math.round(message.prizeTypeId)); + return obj; + }, + + create, I>>(base?: I): GetPrizesInput { + return GetPrizesInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetPrizesInput { + const message = createBaseGetPrizesInput(); + message.projectId = object.projectId ?? 0; + message.prizeTypeId = object.prizeTypeId ?? 0; + return message; + }, +}; + +function createBaseCreatePrizeInput(): CreatePrizeInput { + return { prizeId: 0, projectId: 0, place: 0, prizeAmount: 0, prizeTypeId: 0, numberOfSubmissions: 0 }; +} + +export const CreatePrizeInput = { + encode(message: CreatePrizeInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.prizeId !== 0) { + writer.uint32(8).int32(message.prizeId); + } + if (message.projectId !== 0) { + writer.uint32(16).int32(message.projectId); + } + if (message.place !== 0) { + writer.uint32(24).int32(message.place); + } + if (message.prizeAmount !== 0) { + writer.uint32(37).float(message.prizeAmount); + } + if (message.prizeTypeId !== 0) { + writer.uint32(40).int32(message.prizeTypeId); + } + if (message.numberOfSubmissions !== 0) { + writer.uint32(48).int32(message.numberOfSubmissions); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreatePrizeInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreatePrizeInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prizeId = reader.int32(); + break; + case 2: + message.projectId = reader.int32(); + break; + case 3: + message.place = reader.int32(); + break; + case 4: + message.prizeAmount = reader.float(); + break; + case 5: + message.prizeTypeId = reader.int32(); + break; + case 6: + message.numberOfSubmissions = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreatePrizeInput { + return { + prizeId: isSet(object.prizeId) ? Number(object.prizeId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + place: isSet(object.place) ? Number(object.place) : 0, + prizeAmount: isSet(object.prizeAmount) ? Number(object.prizeAmount) : 0, + prizeTypeId: isSet(object.prizeTypeId) ? Number(object.prizeTypeId) : 0, + numberOfSubmissions: isSet(object.numberOfSubmissions) ? Number(object.numberOfSubmissions) : 0, + }; + }, + + toJSON(message: CreatePrizeInput): unknown { + const obj: any = {}; + message.prizeId !== undefined && (obj.prizeId = Math.round(message.prizeId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.place !== undefined && (obj.place = Math.round(message.place)); + message.prizeAmount !== undefined && (obj.prizeAmount = message.prizeAmount); + message.prizeTypeId !== undefined && (obj.prizeTypeId = Math.round(message.prizeTypeId)); + message.numberOfSubmissions !== undefined && (obj.numberOfSubmissions = Math.round(message.numberOfSubmissions)); + return obj; + }, + + create, I>>(base?: I): CreatePrizeInput { + return CreatePrizeInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreatePrizeInput { + const message = createBaseCreatePrizeInput(); + message.prizeId = object.prizeId ?? 0; + message.projectId = object.projectId ?? 0; + message.place = object.place ?? 0; + message.prizeAmount = object.prizeAmount ?? 0; + message.prizeTypeId = object.prizeTypeId ?? 0; + message.numberOfSubmissions = object.numberOfSubmissions ?? 0; + return message; + }, +}; + +function createBaseUpdatePrizeInput(): UpdatePrizeInput { + return { prizeId: 0, projectId: 0, numberOfSubmissions: 0, prizeAmount: 0 }; +} + +export const UpdatePrizeInput = { + encode(message: UpdatePrizeInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.prizeId !== 0) { + writer.uint32(8).int32(message.prizeId); + } + if (message.projectId !== 0) { + writer.uint32(16).int32(message.projectId); + } + if (message.numberOfSubmissions !== 0) { + writer.uint32(24).int32(message.numberOfSubmissions); + } + if (message.prizeAmount !== 0) { + writer.uint32(37).float(message.prizeAmount); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdatePrizeInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdatePrizeInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prizeId = reader.int32(); + break; + case 2: + message.projectId = reader.int32(); + break; + case 3: + message.numberOfSubmissions = reader.int32(); + break; + case 4: + message.prizeAmount = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdatePrizeInput { + return { + prizeId: isSet(object.prizeId) ? Number(object.prizeId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + numberOfSubmissions: isSet(object.numberOfSubmissions) ? Number(object.numberOfSubmissions) : 0, + prizeAmount: isSet(object.prizeAmount) ? Number(object.prizeAmount) : 0, + }; + }, + + toJSON(message: UpdatePrizeInput): unknown { + const obj: any = {}; + message.prizeId !== undefined && (obj.prizeId = Math.round(message.prizeId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.numberOfSubmissions !== undefined && (obj.numberOfSubmissions = Math.round(message.numberOfSubmissions)); + message.prizeAmount !== undefined && (obj.prizeAmount = message.prizeAmount); + return obj; + }, + + create, I>>(base?: I): UpdatePrizeInput { + return UpdatePrizeInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UpdatePrizeInput { + const message = createBaseUpdatePrizeInput(); + message.prizeId = object.prizeId ?? 0; + message.projectId = object.projectId ?? 0; + message.numberOfSubmissions = object.numberOfSubmissions ?? 0; + message.prizeAmount = object.prizeAmount ?? 0; + return message; + }, +}; + +function createBaseDeletePrizeInput(): DeletePrizeInput { + return { prizeId: 0, projectId: 0 }; +} + +export const DeletePrizeInput = { + encode(message: DeletePrizeInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.prizeId !== 0) { + writer.uint32(8).int32(message.prizeId); + } + if (message.projectId !== 0) { + writer.uint32(16).int32(message.projectId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeletePrizeInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeletePrizeInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prizeId = reader.int32(); + break; + case 2: + message.projectId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeletePrizeInput { + return { + prizeId: isSet(object.prizeId) ? Number(object.prizeId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + }; + }, + + toJSON(message: DeletePrizeInput): unknown { + const obj: any = {}; + message.prizeId !== undefined && (obj.prizeId = Math.round(message.prizeId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + return obj; + }, + + create, I>>(base?: I): DeletePrizeInput { + return DeletePrizeInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeletePrizeInput { + const message = createBaseDeletePrizeInput(); + message.prizeId = object.prizeId ?? 0; + message.projectId = object.projectId ?? 0; + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/phase.ts b/src/models/domain-layer/legacy/phase.ts new file mode 100644 index 0000000..6510e78 --- /dev/null +++ b/src/models/domain-layer/legacy/phase.ts @@ -0,0 +1,1540 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export interface PhaseType { + phaseTypeId: number; + name: string; + description?: string | undefined; + createUser?: number | undefined; + createDate?: string | undefined; + modifyUser?: number | undefined; + modifyDate?: string | undefined; +} + +export interface PhaseTypeList { + phaseTypes: PhaseType[]; +} + +export interface PhaseDependency { + dependentPhaseId: number; + dependencyStart: number; + dependentStart: number; + lagTime: number; + createUser: number; + createDate: number; + modifyUser: number; + modifyDate: number; +} + +export interface CreatePhaseDependencyInput { + dependentPhaseId: number; + dependencyStart: number; + dependentStart: number; + lagTime: number; +} + +export interface PhaseCriteria { + projectPhaseId: number; + phaseCriteriaTypeId: number; + parameter: string; + createUser: number; + createDate: number; + modifyUser: number; + modifyDate: number; +} + +export interface CreatePhaseCriteriaInput { + projectPhaseId: number; + phaseCriteriaTypeId: number; + parameter: string; +} + +export interface DeletePhaseCriteriaInput { + projectPhaseId: number; + phaseCriteriaTypeId?: number | undefined; +} + +export interface PhaseCriteriaList { + phaseCriteriaList: PhaseCriteria[]; +} + +export interface GetPhaseCriteriaInput { + projectPhaseId: number; + phaseCriteriaTypeId?: number | undefined; +} + +export interface ProjectPhase { + projectPhaseId: number; + projectId: number; + phaseTypeId: number; + phaseStatusId: number; + fixedStartTime?: number | undefined; + scheduledStartTime?: number | undefined; + scheduledEndTime?: number | undefined; + actualStartTime?: number | undefined; + actualEndTime?: number | undefined; + duration: number; + createUser?: number | undefined; + createDate?: number | undefined; + modifyUser?: number | undefined; + modifyDate?: number | undefined; +} + +export interface GetProjectPhasesInput { + projectId: number; + phaseTypeId?: number | undefined; +} + +export interface ProjectPhaseList { + projectPhases: ProjectPhase[]; +} + +export interface DeleteProjectPhasesInput { + projectId: number; + projectPhaseId: number; +} + +export interface CreateProjectPhaseInput { + projectId: number; + phaseTypeId: number; + phaseStatusId: number; + fixedStartTime?: string | undefined; + scheduledStartTime?: string | undefined; + scheduledEndTime?: string | undefined; + actualStartTime?: string | undefined; + actualEndTime?: string | undefined; + duration: number; +} + +export interface UpdateProjectPhaseInput { + projectPhaseId: number; + phaseStatusId: number; + fixedStartTime?: string | undefined; + scheduledStartTime?: string | undefined; + scheduledEndTime?: string | undefined; + duration?: number | undefined; + actualStartTime?: string | undefined; + actualEndTime?: string | undefined; +} + +function createBasePhaseType(): PhaseType { + return { + phaseTypeId: 0, + name: "", + description: undefined, + createUser: undefined, + createDate: undefined, + modifyUser: undefined, + modifyDate: undefined, + }; +} + +export const PhaseType = { + encode(message: PhaseType, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.phaseTypeId !== 0) { + writer.uint32(8).int64(message.phaseTypeId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== undefined) { + writer.uint32(26).string(message.description); + } + if (message.createUser !== undefined) { + writer.uint32(32).int32(message.createUser); + } + if (message.createDate !== undefined) { + writer.uint32(42).string(message.createDate); + } + if (message.modifyUser !== undefined) { + writer.uint32(48).int32(message.modifyUser); + } + if (message.modifyDate !== undefined) { + writer.uint32(58).string(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PhaseType { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePhaseType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.phaseTypeId = longToNumber(reader.int64() as Long); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.createUser = reader.int32(); + break; + case 5: + message.createDate = reader.string(); + break; + case 6: + message.modifyUser = reader.int32(); + break; + case 7: + message.modifyDate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PhaseType { + return { + phaseTypeId: isSet(object.phaseTypeId) ? Number(object.phaseTypeId) : 0, + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : undefined, + createUser: isSet(object.createUser) ? Number(object.createUser) : undefined, + createDate: isSet(object.createDate) ? String(object.createDate) : undefined, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : undefined, + modifyDate: isSet(object.modifyDate) ? String(object.modifyDate) : undefined, + }; + }, + + toJSON(message: PhaseType): unknown { + const obj: any = {}; + message.phaseTypeId !== undefined && (obj.phaseTypeId = Math.round(message.phaseTypeId)); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = message.createDate); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = message.modifyDate); + return obj; + }, + + create, I>>(base?: I): PhaseType { + return PhaseType.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): PhaseType { + const message = createBasePhaseType(); + message.phaseTypeId = object.phaseTypeId ?? 0; + message.name = object.name ?? ""; + message.description = object.description ?? undefined; + message.createUser = object.createUser ?? undefined; + message.createDate = object.createDate ?? undefined; + message.modifyUser = object.modifyUser ?? undefined; + message.modifyDate = object.modifyDate ?? undefined; + return message; + }, +}; + +function createBasePhaseTypeList(): PhaseTypeList { + return { phaseTypes: [] }; +} + +export const PhaseTypeList = { + encode(message: PhaseTypeList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.phaseTypes) { + PhaseType.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PhaseTypeList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePhaseTypeList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.phaseTypes.push(PhaseType.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PhaseTypeList { + return { + phaseTypes: Array.isArray(object?.phaseTypes) ? object.phaseTypes.map((e: any) => PhaseType.fromJSON(e)) : [], + }; + }, + + toJSON(message: PhaseTypeList): unknown { + const obj: any = {}; + if (message.phaseTypes) { + obj.phaseTypes = message.phaseTypes.map((e) => e ? PhaseType.toJSON(e) : undefined); + } else { + obj.phaseTypes = []; + } + return obj; + }, + + create, I>>(base?: I): PhaseTypeList { + return PhaseTypeList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): PhaseTypeList { + const message = createBasePhaseTypeList(); + message.phaseTypes = object.phaseTypes?.map((e) => PhaseType.fromPartial(e)) || []; + return message; + }, +}; + +function createBasePhaseDependency(): PhaseDependency { + return { + dependentPhaseId: 0, + dependencyStart: 0, + dependentStart: 0, + lagTime: 0, + createUser: 0, + createDate: 0, + modifyUser: 0, + modifyDate: 0, + }; +} + +export const PhaseDependency = { + encode(message: PhaseDependency, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.dependentPhaseId !== 0) { + writer.uint32(8).int32(message.dependentPhaseId); + } + if (message.dependencyStart !== 0) { + writer.uint32(16).int64(message.dependencyStart); + } + if (message.dependentStart !== 0) { + writer.uint32(24).int64(message.dependentStart); + } + if (message.lagTime !== 0) { + writer.uint32(32).int64(message.lagTime); + } + if (message.createUser !== 0) { + writer.uint32(40).int32(message.createUser); + } + if (message.createDate !== 0) { + writer.uint32(48).int64(message.createDate); + } + if (message.modifyUser !== 0) { + writer.uint32(56).int32(message.modifyUser); + } + if (message.modifyDate !== 0) { + writer.uint32(64).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PhaseDependency { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePhaseDependency(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dependentPhaseId = reader.int32(); + break; + case 2: + message.dependencyStart = longToNumber(reader.int64() as Long); + break; + case 3: + message.dependentStart = longToNumber(reader.int64() as Long); + break; + case 4: + message.lagTime = longToNumber(reader.int64() as Long); + break; + case 5: + message.createUser = reader.int32(); + break; + case 6: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 7: + message.modifyUser = reader.int32(); + break; + case 8: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PhaseDependency { + return { + dependentPhaseId: isSet(object.dependentPhaseId) ? Number(object.dependentPhaseId) : 0, + dependencyStart: isSet(object.dependencyStart) ? Number(object.dependencyStart) : 0, + dependentStart: isSet(object.dependentStart) ? Number(object.dependentStart) : 0, + lagTime: isSet(object.lagTime) ? Number(object.lagTime) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + }; + }, + + toJSON(message: PhaseDependency): unknown { + const obj: any = {}; + message.dependentPhaseId !== undefined && (obj.dependentPhaseId = Math.round(message.dependentPhaseId)); + message.dependencyStart !== undefined && (obj.dependencyStart = Math.round(message.dependencyStart)); + message.dependentStart !== undefined && (obj.dependentStart = Math.round(message.dependentStart)); + message.lagTime !== undefined && (obj.lagTime = Math.round(message.lagTime)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): PhaseDependency { + return PhaseDependency.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): PhaseDependency { + const message = createBasePhaseDependency(); + message.dependentPhaseId = object.dependentPhaseId ?? 0; + message.dependencyStart = object.dependencyStart ?? 0; + message.dependentStart = object.dependentStart ?? 0; + message.lagTime = object.lagTime ?? 0; + message.createUser = object.createUser ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.modifyDate = object.modifyDate ?? 0; + return message; + }, +}; + +function createBaseCreatePhaseDependencyInput(): CreatePhaseDependencyInput { + return { dependentPhaseId: 0, dependencyStart: 0, dependentStart: 0, lagTime: 0 }; +} + +export const CreatePhaseDependencyInput = { + encode(message: CreatePhaseDependencyInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.dependentPhaseId !== 0) { + writer.uint32(8).int32(message.dependentPhaseId); + } + if (message.dependencyStart !== 0) { + writer.uint32(16).int64(message.dependencyStart); + } + if (message.dependentStart !== 0) { + writer.uint32(24).int64(message.dependentStart); + } + if (message.lagTime !== 0) { + writer.uint32(32).int64(message.lagTime); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreatePhaseDependencyInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreatePhaseDependencyInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dependentPhaseId = reader.int32(); + break; + case 2: + message.dependencyStart = longToNumber(reader.int64() as Long); + break; + case 3: + message.dependentStart = longToNumber(reader.int64() as Long); + break; + case 4: + message.lagTime = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreatePhaseDependencyInput { + return { + dependentPhaseId: isSet(object.dependentPhaseId) ? Number(object.dependentPhaseId) : 0, + dependencyStart: isSet(object.dependencyStart) ? Number(object.dependencyStart) : 0, + dependentStart: isSet(object.dependentStart) ? Number(object.dependentStart) : 0, + lagTime: isSet(object.lagTime) ? Number(object.lagTime) : 0, + }; + }, + + toJSON(message: CreatePhaseDependencyInput): unknown { + const obj: any = {}; + message.dependentPhaseId !== undefined && (obj.dependentPhaseId = Math.round(message.dependentPhaseId)); + message.dependencyStart !== undefined && (obj.dependencyStart = Math.round(message.dependencyStart)); + message.dependentStart !== undefined && (obj.dependentStart = Math.round(message.dependentStart)); + message.lagTime !== undefined && (obj.lagTime = Math.round(message.lagTime)); + return obj; + }, + + create, I>>(base?: I): CreatePhaseDependencyInput { + return CreatePhaseDependencyInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreatePhaseDependencyInput { + const message = createBaseCreatePhaseDependencyInput(); + message.dependentPhaseId = object.dependentPhaseId ?? 0; + message.dependencyStart = object.dependencyStart ?? 0; + message.dependentStart = object.dependentStart ?? 0; + message.lagTime = object.lagTime ?? 0; + return message; + }, +}; + +function createBasePhaseCriteria(): PhaseCriteria { + return { + projectPhaseId: 0, + phaseCriteriaTypeId: 0, + parameter: "", + createUser: 0, + createDate: 0, + modifyUser: 0, + modifyDate: 0, + }; +} + +export const PhaseCriteria = { + encode(message: PhaseCriteria, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectPhaseId !== 0) { + writer.uint32(8).int32(message.projectPhaseId); + } + if (message.phaseCriteriaTypeId !== 0) { + writer.uint32(16).int32(message.phaseCriteriaTypeId); + } + if (message.parameter !== "") { + writer.uint32(26).string(message.parameter); + } + if (message.createUser !== 0) { + writer.uint32(32).int32(message.createUser); + } + if (message.createDate !== 0) { + writer.uint32(40).int64(message.createDate); + } + if (message.modifyUser !== 0) { + writer.uint32(48).int32(message.modifyUser); + } + if (message.modifyDate !== 0) { + writer.uint32(56).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PhaseCriteria { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePhaseCriteria(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPhaseId = reader.int32(); + break; + case 2: + message.phaseCriteriaTypeId = reader.int32(); + break; + case 3: + message.parameter = reader.string(); + break; + case 4: + message.createUser = reader.int32(); + break; + case 5: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 6: + message.modifyUser = reader.int32(); + break; + case 7: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PhaseCriteria { + return { + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + phaseCriteriaTypeId: isSet(object.phaseCriteriaTypeId) ? Number(object.phaseCriteriaTypeId) : 0, + parameter: isSet(object.parameter) ? String(object.parameter) : "", + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + }; + }, + + toJSON(message: PhaseCriteria): unknown { + const obj: any = {}; + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.phaseCriteriaTypeId !== undefined && (obj.phaseCriteriaTypeId = Math.round(message.phaseCriteriaTypeId)); + message.parameter !== undefined && (obj.parameter = message.parameter); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): PhaseCriteria { + return PhaseCriteria.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): PhaseCriteria { + const message = createBasePhaseCriteria(); + message.projectPhaseId = object.projectPhaseId ?? 0; + message.phaseCriteriaTypeId = object.phaseCriteriaTypeId ?? 0; + message.parameter = object.parameter ?? ""; + message.createUser = object.createUser ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.modifyDate = object.modifyDate ?? 0; + return message; + }, +}; + +function createBaseCreatePhaseCriteriaInput(): CreatePhaseCriteriaInput { + return { projectPhaseId: 0, phaseCriteriaTypeId: 0, parameter: "" }; +} + +export const CreatePhaseCriteriaInput = { + encode(message: CreatePhaseCriteriaInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectPhaseId !== 0) { + writer.uint32(8).int32(message.projectPhaseId); + } + if (message.phaseCriteriaTypeId !== 0) { + writer.uint32(16).int32(message.phaseCriteriaTypeId); + } + if (message.parameter !== "") { + writer.uint32(26).string(message.parameter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreatePhaseCriteriaInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreatePhaseCriteriaInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPhaseId = reader.int32(); + break; + case 2: + message.phaseCriteriaTypeId = reader.int32(); + break; + case 3: + message.parameter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreatePhaseCriteriaInput { + return { + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + phaseCriteriaTypeId: isSet(object.phaseCriteriaTypeId) ? Number(object.phaseCriteriaTypeId) : 0, + parameter: isSet(object.parameter) ? String(object.parameter) : "", + }; + }, + + toJSON(message: CreatePhaseCriteriaInput): unknown { + const obj: any = {}; + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.phaseCriteriaTypeId !== undefined && (obj.phaseCriteriaTypeId = Math.round(message.phaseCriteriaTypeId)); + message.parameter !== undefined && (obj.parameter = message.parameter); + return obj; + }, + + create, I>>(base?: I): CreatePhaseCriteriaInput { + return CreatePhaseCriteriaInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreatePhaseCriteriaInput { + const message = createBaseCreatePhaseCriteriaInput(); + message.projectPhaseId = object.projectPhaseId ?? 0; + message.phaseCriteriaTypeId = object.phaseCriteriaTypeId ?? 0; + message.parameter = object.parameter ?? ""; + return message; + }, +}; + +function createBaseDeletePhaseCriteriaInput(): DeletePhaseCriteriaInput { + return { projectPhaseId: 0, phaseCriteriaTypeId: undefined }; +} + +export const DeletePhaseCriteriaInput = { + encode(message: DeletePhaseCriteriaInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectPhaseId !== 0) { + writer.uint32(8).int32(message.projectPhaseId); + } + if (message.phaseCriteriaTypeId !== undefined) { + writer.uint32(16).int32(message.phaseCriteriaTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeletePhaseCriteriaInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeletePhaseCriteriaInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPhaseId = reader.int32(); + break; + case 2: + message.phaseCriteriaTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeletePhaseCriteriaInput { + return { + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + phaseCriteriaTypeId: isSet(object.phaseCriteriaTypeId) ? Number(object.phaseCriteriaTypeId) : undefined, + }; + }, + + toJSON(message: DeletePhaseCriteriaInput): unknown { + const obj: any = {}; + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.phaseCriteriaTypeId !== undefined && (obj.phaseCriteriaTypeId = Math.round(message.phaseCriteriaTypeId)); + return obj; + }, + + create, I>>(base?: I): DeletePhaseCriteriaInput { + return DeletePhaseCriteriaInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeletePhaseCriteriaInput { + const message = createBaseDeletePhaseCriteriaInput(); + message.projectPhaseId = object.projectPhaseId ?? 0; + message.phaseCriteriaTypeId = object.phaseCriteriaTypeId ?? undefined; + return message; + }, +}; + +function createBasePhaseCriteriaList(): PhaseCriteriaList { + return { phaseCriteriaList: [] }; +} + +export const PhaseCriteriaList = { + encode(message: PhaseCriteriaList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.phaseCriteriaList) { + PhaseCriteria.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): PhaseCriteriaList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBasePhaseCriteriaList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.phaseCriteriaList.push(PhaseCriteria.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): PhaseCriteriaList { + return { + phaseCriteriaList: Array.isArray(object?.phaseCriteriaList) + ? object.phaseCriteriaList.map((e: any) => PhaseCriteria.fromJSON(e)) + : [], + }; + }, + + toJSON(message: PhaseCriteriaList): unknown { + const obj: any = {}; + if (message.phaseCriteriaList) { + obj.phaseCriteriaList = message.phaseCriteriaList.map((e) => e ? PhaseCriteria.toJSON(e) : undefined); + } else { + obj.phaseCriteriaList = []; + } + return obj; + }, + + create, I>>(base?: I): PhaseCriteriaList { + return PhaseCriteriaList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): PhaseCriteriaList { + const message = createBasePhaseCriteriaList(); + message.phaseCriteriaList = object.phaseCriteriaList?.map((e) => PhaseCriteria.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGetPhaseCriteriaInput(): GetPhaseCriteriaInput { + return { projectPhaseId: 0, phaseCriteriaTypeId: undefined }; +} + +export const GetPhaseCriteriaInput = { + encode(message: GetPhaseCriteriaInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectPhaseId !== 0) { + writer.uint32(8).int32(message.projectPhaseId); + } + if (message.phaseCriteriaTypeId !== undefined) { + writer.uint32(16).int32(message.phaseCriteriaTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetPhaseCriteriaInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetPhaseCriteriaInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPhaseId = reader.int32(); + break; + case 2: + message.phaseCriteriaTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetPhaseCriteriaInput { + return { + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + phaseCriteriaTypeId: isSet(object.phaseCriteriaTypeId) ? Number(object.phaseCriteriaTypeId) : undefined, + }; + }, + + toJSON(message: GetPhaseCriteriaInput): unknown { + const obj: any = {}; + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.phaseCriteriaTypeId !== undefined && (obj.phaseCriteriaTypeId = Math.round(message.phaseCriteriaTypeId)); + return obj; + }, + + create, I>>(base?: I): GetPhaseCriteriaInput { + return GetPhaseCriteriaInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetPhaseCriteriaInput { + const message = createBaseGetPhaseCriteriaInput(); + message.projectPhaseId = object.projectPhaseId ?? 0; + message.phaseCriteriaTypeId = object.phaseCriteriaTypeId ?? undefined; + return message; + }, +}; + +function createBaseProjectPhase(): ProjectPhase { + return { + projectPhaseId: 0, + projectId: 0, + phaseTypeId: 0, + phaseStatusId: 0, + fixedStartTime: undefined, + scheduledStartTime: undefined, + scheduledEndTime: undefined, + actualStartTime: undefined, + actualEndTime: undefined, + duration: 0, + createUser: undefined, + createDate: undefined, + modifyUser: undefined, + modifyDate: undefined, + }; +} + +export const ProjectPhase = { + encode(message: ProjectPhase, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectPhaseId !== 0) { + writer.uint32(8).int64(message.projectPhaseId); + } + if (message.projectId !== 0) { + writer.uint32(16).int64(message.projectId); + } + if (message.phaseTypeId !== 0) { + writer.uint32(24).int64(message.phaseTypeId); + } + if (message.phaseStatusId !== 0) { + writer.uint32(32).int64(message.phaseStatusId); + } + if (message.fixedStartTime !== undefined) { + writer.uint32(40).int64(message.fixedStartTime); + } + if (message.scheduledStartTime !== undefined) { + writer.uint32(48).int64(message.scheduledStartTime); + } + if (message.scheduledEndTime !== undefined) { + writer.uint32(56).int64(message.scheduledEndTime); + } + if (message.actualStartTime !== undefined) { + writer.uint32(64).int64(message.actualStartTime); + } + if (message.actualEndTime !== undefined) { + writer.uint32(72).int64(message.actualEndTime); + } + if (message.duration !== 0) { + writer.uint32(80).int32(message.duration); + } + if (message.createUser !== undefined) { + writer.uint32(88).int32(message.createUser); + } + if (message.createDate !== undefined) { + writer.uint32(96).int64(message.createDate); + } + if (message.modifyUser !== undefined) { + writer.uint32(104).int32(message.modifyUser); + } + if (message.modifyDate !== undefined) { + writer.uint32(112).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProjectPhase { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProjectPhase(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPhaseId = longToNumber(reader.int64() as Long); + break; + case 2: + message.projectId = longToNumber(reader.int64() as Long); + break; + case 3: + message.phaseTypeId = longToNumber(reader.int64() as Long); + break; + case 4: + message.phaseStatusId = longToNumber(reader.int64() as Long); + break; + case 5: + message.fixedStartTime = longToNumber(reader.int64() as Long); + break; + case 6: + message.scheduledStartTime = longToNumber(reader.int64() as Long); + break; + case 7: + message.scheduledEndTime = longToNumber(reader.int64() as Long); + break; + case 8: + message.actualStartTime = longToNumber(reader.int64() as Long); + break; + case 9: + message.actualEndTime = longToNumber(reader.int64() as Long); + break; + case 10: + message.duration = reader.int32(); + break; + case 11: + message.createUser = reader.int32(); + break; + case 12: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 13: + message.modifyUser = reader.int32(); + break; + case 14: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProjectPhase { + return { + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + phaseTypeId: isSet(object.phaseTypeId) ? Number(object.phaseTypeId) : 0, + phaseStatusId: isSet(object.phaseStatusId) ? Number(object.phaseStatusId) : 0, + fixedStartTime: isSet(object.fixedStartTime) ? Number(object.fixedStartTime) : undefined, + scheduledStartTime: isSet(object.scheduledStartTime) ? Number(object.scheduledStartTime) : undefined, + scheduledEndTime: isSet(object.scheduledEndTime) ? Number(object.scheduledEndTime) : undefined, + actualStartTime: isSet(object.actualStartTime) ? Number(object.actualStartTime) : undefined, + actualEndTime: isSet(object.actualEndTime) ? Number(object.actualEndTime) : undefined, + duration: isSet(object.duration) ? Number(object.duration) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : undefined, + createDate: isSet(object.createDate) ? Number(object.createDate) : undefined, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : undefined, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : undefined, + }; + }, + + toJSON(message: ProjectPhase): unknown { + const obj: any = {}; + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.phaseTypeId !== undefined && (obj.phaseTypeId = Math.round(message.phaseTypeId)); + message.phaseStatusId !== undefined && (obj.phaseStatusId = Math.round(message.phaseStatusId)); + message.fixedStartTime !== undefined && (obj.fixedStartTime = Math.round(message.fixedStartTime)); + message.scheduledStartTime !== undefined && (obj.scheduledStartTime = Math.round(message.scheduledStartTime)); + message.scheduledEndTime !== undefined && (obj.scheduledEndTime = Math.round(message.scheduledEndTime)); + message.actualStartTime !== undefined && (obj.actualStartTime = Math.round(message.actualStartTime)); + message.actualEndTime !== undefined && (obj.actualEndTime = Math.round(message.actualEndTime)); + message.duration !== undefined && (obj.duration = Math.round(message.duration)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): ProjectPhase { + return ProjectPhase.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ProjectPhase { + const message = createBaseProjectPhase(); + message.projectPhaseId = object.projectPhaseId ?? 0; + message.projectId = object.projectId ?? 0; + message.phaseTypeId = object.phaseTypeId ?? 0; + message.phaseStatusId = object.phaseStatusId ?? 0; + message.fixedStartTime = object.fixedStartTime ?? undefined; + message.scheduledStartTime = object.scheduledStartTime ?? undefined; + message.scheduledEndTime = object.scheduledEndTime ?? undefined; + message.actualStartTime = object.actualStartTime ?? undefined; + message.actualEndTime = object.actualEndTime ?? undefined; + message.duration = object.duration ?? 0; + message.createUser = object.createUser ?? undefined; + message.createDate = object.createDate ?? undefined; + message.modifyUser = object.modifyUser ?? undefined; + message.modifyDate = object.modifyDate ?? undefined; + return message; + }, +}; + +function createBaseGetProjectPhasesInput(): GetProjectPhasesInput { + return { projectId: 0, phaseTypeId: undefined }; +} + +export const GetProjectPhasesInput = { + encode(message: GetProjectPhasesInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.phaseTypeId !== undefined) { + writer.uint32(16).int32(message.phaseTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetProjectPhasesInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetProjectPhasesInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.phaseTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetProjectPhasesInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + phaseTypeId: isSet(object.phaseTypeId) ? Number(object.phaseTypeId) : undefined, + }; + }, + + toJSON(message: GetProjectPhasesInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.phaseTypeId !== undefined && (obj.phaseTypeId = Math.round(message.phaseTypeId)); + return obj; + }, + + create, I>>(base?: I): GetProjectPhasesInput { + return GetProjectPhasesInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetProjectPhasesInput { + const message = createBaseGetProjectPhasesInput(); + message.projectId = object.projectId ?? 0; + message.phaseTypeId = object.phaseTypeId ?? undefined; + return message; + }, +}; + +function createBaseProjectPhaseList(): ProjectPhaseList { + return { projectPhases: [] }; +} + +export const ProjectPhaseList = { + encode(message: ProjectPhaseList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.projectPhases) { + ProjectPhase.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProjectPhaseList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProjectPhaseList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPhases.push(ProjectPhase.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProjectPhaseList { + return { + projectPhases: Array.isArray(object?.projectPhases) + ? object.projectPhases.map((e: any) => ProjectPhase.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ProjectPhaseList): unknown { + const obj: any = {}; + if (message.projectPhases) { + obj.projectPhases = message.projectPhases.map((e) => e ? ProjectPhase.toJSON(e) : undefined); + } else { + obj.projectPhases = []; + } + return obj; + }, + + create, I>>(base?: I): ProjectPhaseList { + return ProjectPhaseList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ProjectPhaseList { + const message = createBaseProjectPhaseList(); + message.projectPhases = object.projectPhases?.map((e) => ProjectPhase.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseDeleteProjectPhasesInput(): DeleteProjectPhasesInput { + return { projectId: 0, projectPhaseId: 0 }; +} + +export const DeleteProjectPhasesInput = { + encode(message: DeleteProjectPhasesInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.projectPhaseId !== 0) { + writer.uint32(16).int32(message.projectPhaseId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteProjectPhasesInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteProjectPhasesInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.projectPhaseId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteProjectPhasesInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + }; + }, + + toJSON(message: DeleteProjectPhasesInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + return obj; + }, + + create, I>>(base?: I): DeleteProjectPhasesInput { + return DeleteProjectPhasesInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeleteProjectPhasesInput { + const message = createBaseDeleteProjectPhasesInput(); + message.projectId = object.projectId ?? 0; + message.projectPhaseId = object.projectPhaseId ?? 0; + return message; + }, +}; + +function createBaseCreateProjectPhaseInput(): CreateProjectPhaseInput { + return { + projectId: 0, + phaseTypeId: 0, + phaseStatusId: 0, + fixedStartTime: undefined, + scheduledStartTime: undefined, + scheduledEndTime: undefined, + actualStartTime: undefined, + actualEndTime: undefined, + duration: 0, + }; +} + +export const CreateProjectPhaseInput = { + encode(message: CreateProjectPhaseInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int64(message.projectId); + } + if (message.phaseTypeId !== 0) { + writer.uint32(16).int64(message.phaseTypeId); + } + if (message.phaseStatusId !== 0) { + writer.uint32(24).int64(message.phaseStatusId); + } + if (message.fixedStartTime !== undefined) { + writer.uint32(34).string(message.fixedStartTime); + } + if (message.scheduledStartTime !== undefined) { + writer.uint32(42).string(message.scheduledStartTime); + } + if (message.scheduledEndTime !== undefined) { + writer.uint32(50).string(message.scheduledEndTime); + } + if (message.actualStartTime !== undefined) { + writer.uint32(58).string(message.actualStartTime); + } + if (message.actualEndTime !== undefined) { + writer.uint32(66).string(message.actualEndTime); + } + if (message.duration !== 0) { + writer.uint32(72).int32(message.duration); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateProjectPhaseInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateProjectPhaseInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = longToNumber(reader.int64() as Long); + break; + case 2: + message.phaseTypeId = longToNumber(reader.int64() as Long); + break; + case 3: + message.phaseStatusId = longToNumber(reader.int64() as Long); + break; + case 4: + message.fixedStartTime = reader.string(); + break; + case 5: + message.scheduledStartTime = reader.string(); + break; + case 6: + message.scheduledEndTime = reader.string(); + break; + case 7: + message.actualStartTime = reader.string(); + break; + case 8: + message.actualEndTime = reader.string(); + break; + case 9: + message.duration = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateProjectPhaseInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + phaseTypeId: isSet(object.phaseTypeId) ? Number(object.phaseTypeId) : 0, + phaseStatusId: isSet(object.phaseStatusId) ? Number(object.phaseStatusId) : 0, + fixedStartTime: isSet(object.fixedStartTime) ? String(object.fixedStartTime) : undefined, + scheduledStartTime: isSet(object.scheduledStartTime) ? String(object.scheduledStartTime) : undefined, + scheduledEndTime: isSet(object.scheduledEndTime) ? String(object.scheduledEndTime) : undefined, + actualStartTime: isSet(object.actualStartTime) ? String(object.actualStartTime) : undefined, + actualEndTime: isSet(object.actualEndTime) ? String(object.actualEndTime) : undefined, + duration: isSet(object.duration) ? Number(object.duration) : 0, + }; + }, + + toJSON(message: CreateProjectPhaseInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.phaseTypeId !== undefined && (obj.phaseTypeId = Math.round(message.phaseTypeId)); + message.phaseStatusId !== undefined && (obj.phaseStatusId = Math.round(message.phaseStatusId)); + message.fixedStartTime !== undefined && (obj.fixedStartTime = message.fixedStartTime); + message.scheduledStartTime !== undefined && (obj.scheduledStartTime = message.scheduledStartTime); + message.scheduledEndTime !== undefined && (obj.scheduledEndTime = message.scheduledEndTime); + message.actualStartTime !== undefined && (obj.actualStartTime = message.actualStartTime); + message.actualEndTime !== undefined && (obj.actualEndTime = message.actualEndTime); + message.duration !== undefined && (obj.duration = Math.round(message.duration)); + return obj; + }, + + create, I>>(base?: I): CreateProjectPhaseInput { + return CreateProjectPhaseInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateProjectPhaseInput { + const message = createBaseCreateProjectPhaseInput(); + message.projectId = object.projectId ?? 0; + message.phaseTypeId = object.phaseTypeId ?? 0; + message.phaseStatusId = object.phaseStatusId ?? 0; + message.fixedStartTime = object.fixedStartTime ?? undefined; + message.scheduledStartTime = object.scheduledStartTime ?? undefined; + message.scheduledEndTime = object.scheduledEndTime ?? undefined; + message.actualStartTime = object.actualStartTime ?? undefined; + message.actualEndTime = object.actualEndTime ?? undefined; + message.duration = object.duration ?? 0; + return message; + }, +}; + +function createBaseUpdateProjectPhaseInput(): UpdateProjectPhaseInput { + return { + projectPhaseId: 0, + phaseStatusId: 0, + fixedStartTime: undefined, + scheduledStartTime: undefined, + scheduledEndTime: undefined, + duration: undefined, + actualStartTime: undefined, + actualEndTime: undefined, + }; +} + +export const UpdateProjectPhaseInput = { + encode(message: UpdateProjectPhaseInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectPhaseId !== 0) { + writer.uint32(8).int64(message.projectPhaseId); + } + if (message.phaseStatusId !== 0) { + writer.uint32(16).int32(message.phaseStatusId); + } + if (message.fixedStartTime !== undefined) { + writer.uint32(26).string(message.fixedStartTime); + } + if (message.scheduledStartTime !== undefined) { + writer.uint32(34).string(message.scheduledStartTime); + } + if (message.scheduledEndTime !== undefined) { + writer.uint32(42).string(message.scheduledEndTime); + } + if (message.duration !== undefined) { + writer.uint32(48).int64(message.duration); + } + if (message.actualStartTime !== undefined) { + writer.uint32(58).string(message.actualStartTime); + } + if (message.actualEndTime !== undefined) { + writer.uint32(66).string(message.actualEndTime); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateProjectPhaseInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateProjectPhaseInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectPhaseId = longToNumber(reader.int64() as Long); + break; + case 2: + message.phaseStatusId = reader.int32(); + break; + case 3: + message.fixedStartTime = reader.string(); + break; + case 4: + message.scheduledStartTime = reader.string(); + break; + case 5: + message.scheduledEndTime = reader.string(); + break; + case 6: + message.duration = longToNumber(reader.int64() as Long); + break; + case 7: + message.actualStartTime = reader.string(); + break; + case 8: + message.actualEndTime = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateProjectPhaseInput { + return { + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + phaseStatusId: isSet(object.phaseStatusId) ? Number(object.phaseStatusId) : 0, + fixedStartTime: isSet(object.fixedStartTime) ? String(object.fixedStartTime) : undefined, + scheduledStartTime: isSet(object.scheduledStartTime) ? String(object.scheduledStartTime) : undefined, + scheduledEndTime: isSet(object.scheduledEndTime) ? String(object.scheduledEndTime) : undefined, + duration: isSet(object.duration) ? Number(object.duration) : undefined, + actualStartTime: isSet(object.actualStartTime) ? String(object.actualStartTime) : undefined, + actualEndTime: isSet(object.actualEndTime) ? String(object.actualEndTime) : undefined, + }; + }, + + toJSON(message: UpdateProjectPhaseInput): unknown { + const obj: any = {}; + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.phaseStatusId !== undefined && (obj.phaseStatusId = Math.round(message.phaseStatusId)); + message.fixedStartTime !== undefined && (obj.fixedStartTime = message.fixedStartTime); + message.scheduledStartTime !== undefined && (obj.scheduledStartTime = message.scheduledStartTime); + message.scheduledEndTime !== undefined && (obj.scheduledEndTime = message.scheduledEndTime); + message.duration !== undefined && (obj.duration = Math.round(message.duration)); + message.actualStartTime !== undefined && (obj.actualStartTime = message.actualStartTime); + message.actualEndTime !== undefined && (obj.actualEndTime = message.actualEndTime); + return obj; + }, + + create, I>>(base?: I): UpdateProjectPhaseInput { + return UpdateProjectPhaseInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UpdateProjectPhaseInput { + const message = createBaseUpdateProjectPhaseInput(); + message.projectPhaseId = object.projectPhaseId ?? 0; + message.phaseStatusId = object.phaseStatusId ?? 0; + message.fixedStartTime = object.fixedStartTime ?? undefined; + message.scheduledStartTime = object.scheduledStartTime ?? undefined; + message.scheduledEndTime = object.scheduledEndTime ?? undefined; + message.duration = object.duration ?? undefined; + message.actualStartTime = object.actualStartTime ?? undefined; + message.actualEndTime = object.actualEndTime ?? undefined; + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/prize.ts b/src/models/domain-layer/legacy/prize.ts index e2a0e00..978e2c4 100644 --- a/src/models/domain-layer/legacy/prize.ts +++ b/src/models/domain-layer/legacy/prize.ts @@ -54,6 +54,11 @@ export interface UpdatePrizeInput_UpdateCriteria { prizeId?: number | undefined; } +export interface DeletePrizeInput { + prizeId: number; + projectId: number; +} + function createBasePrize(): Prize { return { prizeId: 0, @@ -686,6 +691,68 @@ export const UpdatePrizeInput_UpdateCriteria = { }, }; +function createBaseDeletePrizeInput(): DeletePrizeInput { + return { prizeId: 0, projectId: 0 }; +} + +export const DeletePrizeInput = { + encode(message: DeletePrizeInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.prizeId !== 0) { + writer.uint32(8).int32(message.prizeId); + } + if (message.projectId !== 0) { + writer.uint32(16).int32(message.projectId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeletePrizeInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeletePrizeInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.prizeId = reader.int32(); + break; + case 2: + message.projectId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeletePrizeInput { + return { + prizeId: isSet(object.prizeId) ? Number(object.prizeId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + }; + }, + + toJSON(message: DeletePrizeInput): unknown { + const obj: any = {}; + message.prizeId !== undefined && (obj.prizeId = Math.round(message.prizeId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + return obj; + }, + + create, I>>(base?: I): DeletePrizeInput { + return DeletePrizeInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeletePrizeInput { + const message = createBaseDeletePrizeInput(); + message.prizeId = object.prizeId ?? 0; + message.projectId = object.projectId ?? 0; + return message; + }, +}; + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/models/domain-layer/legacy/project_info.ts b/src/models/domain-layer/legacy/project_info.ts new file mode 100644 index 0000000..dab61e5 --- /dev/null +++ b/src/models/domain-layer/legacy/project_info.ts @@ -0,0 +1,682 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export interface ProjectInfo { + projectId: number; + projectInfoTypeId: number; + value: string; + createUser?: number | undefined; + createDate?: string | undefined; + modifyUser?: number | undefined; + modifyDate?: string | undefined; +} + +export interface ProjectInfoList { + projectInfos: ProjectInfo[]; +} + +export interface GetProjectInfoInput { + projectId: number; + projectInfoTypeId?: number | undefined; +} + +export interface CreateProjectInfoInput { + projectId: number; + projectInfoTypeId: number; + value: string; +} + +export interface DeleteProjectInfoInput { + projectId: number; + projectInfoTypeId: number; +} + +export interface UpdateProjectInfoInput { + projectId: number; + projectInfoTypeId: number; + value: string; +} + +export interface ProjectInfoType { + projectInfoTypeId: number; + name: string; + description: string; + createUser?: number | undefined; + createDate?: string | undefined; + modifyUser?: number | undefined; + modifyDate?: string | undefined; +} + +export interface ProjectInfoTypeList { + projectInfoTypes: ProjectInfoType[]; +} + +function createBaseProjectInfo(): ProjectInfo { + return { + projectId: 0, + projectInfoTypeId: 0, + value: "", + createUser: undefined, + createDate: undefined, + modifyUser: undefined, + modifyDate: undefined, + }; +} + +export const ProjectInfo = { + encode(message: ProjectInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.projectInfoTypeId !== 0) { + writer.uint32(16).int32(message.projectInfoTypeId); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + if (message.createUser !== undefined) { + writer.uint32(32).int32(message.createUser); + } + if (message.createDate !== undefined) { + writer.uint32(42).string(message.createDate); + } + if (message.modifyUser !== undefined) { + writer.uint32(48).int32(message.modifyUser); + } + if (message.modifyDate !== undefined) { + writer.uint32(58).string(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProjectInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProjectInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.projectInfoTypeId = reader.int32(); + break; + case 3: + message.value = reader.string(); + break; + case 4: + message.createUser = reader.int32(); + break; + case 5: + message.createDate = reader.string(); + break; + case 6: + message.modifyUser = reader.int32(); + break; + case 7: + message.modifyDate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProjectInfo { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + projectInfoTypeId: isSet(object.projectInfoTypeId) ? Number(object.projectInfoTypeId) : 0, + value: isSet(object.value) ? String(object.value) : "", + createUser: isSet(object.createUser) ? Number(object.createUser) : undefined, + createDate: isSet(object.createDate) ? String(object.createDate) : undefined, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : undefined, + modifyDate: isSet(object.modifyDate) ? String(object.modifyDate) : undefined, + }; + }, + + toJSON(message: ProjectInfo): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.projectInfoTypeId !== undefined && (obj.projectInfoTypeId = Math.round(message.projectInfoTypeId)); + message.value !== undefined && (obj.value = message.value); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = message.createDate); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = message.modifyDate); + return obj; + }, + + create, I>>(base?: I): ProjectInfo { + return ProjectInfo.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ProjectInfo { + const message = createBaseProjectInfo(); + message.projectId = object.projectId ?? 0; + message.projectInfoTypeId = object.projectInfoTypeId ?? 0; + message.value = object.value ?? ""; + message.createUser = object.createUser ?? undefined; + message.createDate = object.createDate ?? undefined; + message.modifyUser = object.modifyUser ?? undefined; + message.modifyDate = object.modifyDate ?? undefined; + return message; + }, +}; + +function createBaseProjectInfoList(): ProjectInfoList { + return { projectInfos: [] }; +} + +export const ProjectInfoList = { + encode(message: ProjectInfoList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.projectInfos) { + ProjectInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProjectInfoList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProjectInfoList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectInfos.push(ProjectInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProjectInfoList { + return { + projectInfos: Array.isArray(object?.projectInfos) + ? object.projectInfos.map((e: any) => ProjectInfo.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ProjectInfoList): unknown { + const obj: any = {}; + if (message.projectInfos) { + obj.projectInfos = message.projectInfos.map((e) => e ? ProjectInfo.toJSON(e) : undefined); + } else { + obj.projectInfos = []; + } + return obj; + }, + + create, I>>(base?: I): ProjectInfoList { + return ProjectInfoList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ProjectInfoList { + const message = createBaseProjectInfoList(); + message.projectInfos = object.projectInfos?.map((e) => ProjectInfo.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGetProjectInfoInput(): GetProjectInfoInput { + return { projectId: 0, projectInfoTypeId: undefined }; +} + +export const GetProjectInfoInput = { + encode(message: GetProjectInfoInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.projectInfoTypeId !== undefined) { + writer.uint32(16).int32(message.projectInfoTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetProjectInfoInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetProjectInfoInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.projectInfoTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetProjectInfoInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + projectInfoTypeId: isSet(object.projectInfoTypeId) ? Number(object.projectInfoTypeId) : undefined, + }; + }, + + toJSON(message: GetProjectInfoInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.projectInfoTypeId !== undefined && (obj.projectInfoTypeId = Math.round(message.projectInfoTypeId)); + return obj; + }, + + create, I>>(base?: I): GetProjectInfoInput { + return GetProjectInfoInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetProjectInfoInput { + const message = createBaseGetProjectInfoInput(); + message.projectId = object.projectId ?? 0; + message.projectInfoTypeId = object.projectInfoTypeId ?? undefined; + return message; + }, +}; + +function createBaseCreateProjectInfoInput(): CreateProjectInfoInput { + return { projectId: 0, projectInfoTypeId: 0, value: "" }; +} + +export const CreateProjectInfoInput = { + encode(message: CreateProjectInfoInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.projectInfoTypeId !== 0) { + writer.uint32(16).int32(message.projectInfoTypeId); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateProjectInfoInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateProjectInfoInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.projectInfoTypeId = reader.int32(); + break; + case 3: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateProjectInfoInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + projectInfoTypeId: isSet(object.projectInfoTypeId) ? Number(object.projectInfoTypeId) : 0, + value: isSet(object.value) ? String(object.value) : "", + }; + }, + + toJSON(message: CreateProjectInfoInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.projectInfoTypeId !== undefined && (obj.projectInfoTypeId = Math.round(message.projectInfoTypeId)); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + create, I>>(base?: I): CreateProjectInfoInput { + return CreateProjectInfoInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateProjectInfoInput { + const message = createBaseCreateProjectInfoInput(); + message.projectId = object.projectId ?? 0; + message.projectInfoTypeId = object.projectInfoTypeId ?? 0; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseDeleteProjectInfoInput(): DeleteProjectInfoInput { + return { projectId: 0, projectInfoTypeId: 0 }; +} + +export const DeleteProjectInfoInput = { + encode(message: DeleteProjectInfoInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.projectInfoTypeId !== 0) { + writer.uint32(16).int32(message.projectInfoTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteProjectInfoInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteProjectInfoInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.projectInfoTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteProjectInfoInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + projectInfoTypeId: isSet(object.projectInfoTypeId) ? Number(object.projectInfoTypeId) : 0, + }; + }, + + toJSON(message: DeleteProjectInfoInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.projectInfoTypeId !== undefined && (obj.projectInfoTypeId = Math.round(message.projectInfoTypeId)); + return obj; + }, + + create, I>>(base?: I): DeleteProjectInfoInput { + return DeleteProjectInfoInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeleteProjectInfoInput { + const message = createBaseDeleteProjectInfoInput(); + message.projectId = object.projectId ?? 0; + message.projectInfoTypeId = object.projectInfoTypeId ?? 0; + return message; + }, +}; + +function createBaseUpdateProjectInfoInput(): UpdateProjectInfoInput { + return { projectId: 0, projectInfoTypeId: 0, value: "" }; +} + +export const UpdateProjectInfoInput = { + encode(message: UpdateProjectInfoInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.projectInfoTypeId !== 0) { + writer.uint32(16).int32(message.projectInfoTypeId); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateProjectInfoInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateProjectInfoInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.projectInfoTypeId = reader.int32(); + break; + case 3: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateProjectInfoInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + projectInfoTypeId: isSet(object.projectInfoTypeId) ? Number(object.projectInfoTypeId) : 0, + value: isSet(object.value) ? String(object.value) : "", + }; + }, + + toJSON(message: UpdateProjectInfoInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.projectInfoTypeId !== undefined && (obj.projectInfoTypeId = Math.round(message.projectInfoTypeId)); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + create, I>>(base?: I): UpdateProjectInfoInput { + return UpdateProjectInfoInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UpdateProjectInfoInput { + const message = createBaseUpdateProjectInfoInput(); + message.projectId = object.projectId ?? 0; + message.projectInfoTypeId = object.projectInfoTypeId ?? 0; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseProjectInfoType(): ProjectInfoType { + return { + projectInfoTypeId: 0, + name: "", + description: "", + createUser: undefined, + createDate: undefined, + modifyUser: undefined, + modifyDate: undefined, + }; +} + +export const ProjectInfoType = { + encode(message: ProjectInfoType, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectInfoTypeId !== 0) { + writer.uint32(8).int32(message.projectInfoTypeId); + } + if (message.name !== "") { + writer.uint32(18).string(message.name); + } + if (message.description !== "") { + writer.uint32(26).string(message.description); + } + if (message.createUser !== undefined) { + writer.uint32(32).int32(message.createUser); + } + if (message.createDate !== undefined) { + writer.uint32(42).string(message.createDate); + } + if (message.modifyUser !== undefined) { + writer.uint32(48).int32(message.modifyUser); + } + if (message.modifyDate !== undefined) { + writer.uint32(58).string(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProjectInfoType { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProjectInfoType(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectInfoTypeId = reader.int32(); + break; + case 2: + message.name = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.createUser = reader.int32(); + break; + case 5: + message.createDate = reader.string(); + break; + case 6: + message.modifyUser = reader.int32(); + break; + case 7: + message.modifyDate = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProjectInfoType { + return { + projectInfoTypeId: isSet(object.projectInfoTypeId) ? Number(object.projectInfoTypeId) : 0, + name: isSet(object.name) ? String(object.name) : "", + description: isSet(object.description) ? String(object.description) : "", + createUser: isSet(object.createUser) ? Number(object.createUser) : undefined, + createDate: isSet(object.createDate) ? String(object.createDate) : undefined, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : undefined, + modifyDate: isSet(object.modifyDate) ? String(object.modifyDate) : undefined, + }; + }, + + toJSON(message: ProjectInfoType): unknown { + const obj: any = {}; + message.projectInfoTypeId !== undefined && (obj.projectInfoTypeId = Math.round(message.projectInfoTypeId)); + message.name !== undefined && (obj.name = message.name); + message.description !== undefined && (obj.description = message.description); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = message.createDate); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = message.modifyDate); + return obj; + }, + + create, I>>(base?: I): ProjectInfoType { + return ProjectInfoType.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ProjectInfoType { + const message = createBaseProjectInfoType(); + message.projectInfoTypeId = object.projectInfoTypeId ?? 0; + message.name = object.name ?? ""; + message.description = object.description ?? ""; + message.createUser = object.createUser ?? undefined; + message.createDate = object.createDate ?? undefined; + message.modifyUser = object.modifyUser ?? undefined; + message.modifyDate = object.modifyDate ?? undefined; + return message; + }, +}; + +function createBaseProjectInfoTypeList(): ProjectInfoTypeList { + return { projectInfoTypes: [] }; +} + +export const ProjectInfoTypeList = { + encode(message: ProjectInfoTypeList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.projectInfoTypes) { + ProjectInfoType.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProjectInfoTypeList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProjectInfoTypeList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectInfoTypes.push(ProjectInfoType.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProjectInfoTypeList { + return { + projectInfoTypes: Array.isArray(object?.projectInfoTypes) + ? object.projectInfoTypes.map((e: any) => ProjectInfoType.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ProjectInfoTypeList): unknown { + const obj: any = {}; + if (message.projectInfoTypes) { + obj.projectInfoTypes = message.projectInfoTypes.map((e) => e ? ProjectInfoType.toJSON(e) : undefined); + } else { + obj.projectInfoTypes = []; + } + return obj; + }, + + create, I>>(base?: I): ProjectInfoTypeList { + return ProjectInfoTypeList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ProjectInfoTypeList { + const message = createBaseProjectInfoTypeList(); + message.projectInfoTypes = object.projectInfoTypes?.map((e) => ProjectInfoType.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/resource.ts b/src/models/domain-layer/legacy/resource.ts index 4700eef..068fc88 100644 --- a/src/models/domain-layer/legacy/resource.ts +++ b/src/models/domain-layer/legacy/resource.ts @@ -14,6 +14,62 @@ export interface Resource { modifyDate: number; } +export interface CreateResourceInput { + resourceRoleId: number; + projectId: number; + projectPhaseId?: number | undefined; + userId: number; +} + +export interface GetResourcesInput { + projectId: number; + resourceRoleId?: number | undefined; +} + +export interface DeleteResourcesInput { + projectId: number; + resourceRoleId?: number | undefined; +} + +export interface ResourceList { + resources: Resource[]; +} + +export interface ResourceInfo { + resourceId: number; + resourceInfoTypeId: number; + value: string; + createUser: number; + createDate: number; + modifyUser: number; + modifyDate: number; +} + +export interface CreateResourceInfoInput { + resourceId: number; + resourceInfoTypeId: number; + value: string; +} + +export interface UpdateResourceInfoInput { + resourceId: number; + resourceInfoTypeId: number; + value: string; +} + +export interface DeleteResourceInfoInput { + resourceId: number; +} + +export interface GetResourceInfosInput { + resourceId: number; + resourceInfoTypeId?: number | undefined; +} + +export interface ResourceInfoList { + resourceInfos: ResourceInfo[]; +} + function createBaseResource(): Resource { return { resourceId: 0, @@ -149,6 +205,696 @@ export const Resource = { }, }; +function createBaseCreateResourceInput(): CreateResourceInput { + return { resourceRoleId: 0, projectId: 0, projectPhaseId: undefined, userId: 0 }; +} + +export const CreateResourceInput = { + encode(message: CreateResourceInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceRoleId !== 0) { + writer.uint32(16).int32(message.resourceRoleId); + } + if (message.projectId !== 0) { + writer.uint32(24).int32(message.projectId); + } + if (message.projectPhaseId !== undefined) { + writer.uint32(32).int32(message.projectPhaseId); + } + if (message.userId !== 0) { + writer.uint32(40).int32(message.userId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateResourceInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateResourceInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.resourceRoleId = reader.int32(); + break; + case 3: + message.projectId = reader.int32(); + break; + case 4: + message.projectPhaseId = reader.int32(); + break; + case 5: + message.userId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateResourceInput { + return { + resourceRoleId: isSet(object.resourceRoleId) ? Number(object.resourceRoleId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : undefined, + userId: isSet(object.userId) ? Number(object.userId) : 0, + }; + }, + + toJSON(message: CreateResourceInput): unknown { + const obj: any = {}; + message.resourceRoleId !== undefined && (obj.resourceRoleId = Math.round(message.resourceRoleId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.userId !== undefined && (obj.userId = Math.round(message.userId)); + return obj; + }, + + create, I>>(base?: I): CreateResourceInput { + return CreateResourceInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateResourceInput { + const message = createBaseCreateResourceInput(); + message.resourceRoleId = object.resourceRoleId ?? 0; + message.projectId = object.projectId ?? 0; + message.projectPhaseId = object.projectPhaseId ?? undefined; + message.userId = object.userId ?? 0; + return message; + }, +}; + +function createBaseGetResourcesInput(): GetResourcesInput { + return { projectId: 0, resourceRoleId: undefined }; +} + +export const GetResourcesInput = { + encode(message: GetResourcesInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.resourceRoleId !== undefined) { + writer.uint32(16).int32(message.resourceRoleId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetResourcesInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetResourcesInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.resourceRoleId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetResourcesInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + resourceRoleId: isSet(object.resourceRoleId) ? Number(object.resourceRoleId) : undefined, + }; + }, + + toJSON(message: GetResourcesInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.resourceRoleId !== undefined && (obj.resourceRoleId = Math.round(message.resourceRoleId)); + return obj; + }, + + create, I>>(base?: I): GetResourcesInput { + return GetResourcesInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetResourcesInput { + const message = createBaseGetResourcesInput(); + message.projectId = object.projectId ?? 0; + message.resourceRoleId = object.resourceRoleId ?? undefined; + return message; + }, +}; + +function createBaseDeleteResourcesInput(): DeleteResourcesInput { + return { projectId: 0, resourceRoleId: undefined }; +} + +export const DeleteResourcesInput = { + encode(message: DeleteResourcesInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.resourceRoleId !== undefined) { + writer.uint32(16).int32(message.resourceRoleId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteResourcesInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteResourcesInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.resourceRoleId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteResourcesInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + resourceRoleId: isSet(object.resourceRoleId) ? Number(object.resourceRoleId) : undefined, + }; + }, + + toJSON(message: DeleteResourcesInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.resourceRoleId !== undefined && (obj.resourceRoleId = Math.round(message.resourceRoleId)); + return obj; + }, + + create, I>>(base?: I): DeleteResourcesInput { + return DeleteResourcesInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeleteResourcesInput { + const message = createBaseDeleteResourcesInput(); + message.projectId = object.projectId ?? 0; + message.resourceRoleId = object.resourceRoleId ?? undefined; + return message; + }, +}; + +function createBaseResourceList(): ResourceList { + return { resources: [] }; +} + +export const ResourceList = { + encode(message: ResourceList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.resources) { + Resource.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourceList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourceList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resources.push(Resource.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResourceList { + return { + resources: Array.isArray(object?.resources) ? object.resources.map((e: any) => Resource.fromJSON(e)) : [], + }; + }, + + toJSON(message: ResourceList): unknown { + const obj: any = {}; + if (message.resources) { + obj.resources = message.resources.map((e) => e ? Resource.toJSON(e) : undefined); + } else { + obj.resources = []; + } + return obj; + }, + + create, I>>(base?: I): ResourceList { + return ResourceList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ResourceList { + const message = createBaseResourceList(); + message.resources = object.resources?.map((e) => Resource.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseResourceInfo(): ResourceInfo { + return { + resourceId: 0, + resourceInfoTypeId: 0, + value: "", + createUser: 0, + createDate: 0, + modifyUser: 0, + modifyDate: 0, + }; +} + +export const ResourceInfo = { + encode(message: ResourceInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.resourceInfoTypeId !== 0) { + writer.uint32(16).int32(message.resourceInfoTypeId); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + if (message.createUser !== 0) { + writer.uint32(32).int32(message.createUser); + } + if (message.createDate !== 0) { + writer.uint32(40).int64(message.createDate); + } + if (message.modifyUser !== 0) { + writer.uint32(48).int32(message.modifyUser); + } + if (message.modifyDate !== 0) { + writer.uint32(56).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourceInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourceInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.resourceInfoTypeId = reader.int32(); + break; + case 3: + message.value = reader.string(); + break; + case 4: + message.createUser = reader.int32(); + break; + case 5: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 6: + message.modifyUser = reader.int32(); + break; + case 7: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResourceInfo { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + resourceInfoTypeId: isSet(object.resourceInfoTypeId) ? Number(object.resourceInfoTypeId) : 0, + value: isSet(object.value) ? String(object.value) : "", + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + }; + }, + + toJSON(message: ResourceInfo): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.resourceInfoTypeId !== undefined && (obj.resourceInfoTypeId = Math.round(message.resourceInfoTypeId)); + message.value !== undefined && (obj.value = message.value); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): ResourceInfo { + return ResourceInfo.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ResourceInfo { + const message = createBaseResourceInfo(); + message.resourceId = object.resourceId ?? 0; + message.resourceInfoTypeId = object.resourceInfoTypeId ?? 0; + message.value = object.value ?? ""; + message.createUser = object.createUser ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.modifyDate = object.modifyDate ?? 0; + return message; + }, +}; + +function createBaseCreateResourceInfoInput(): CreateResourceInfoInput { + return { resourceId: 0, resourceInfoTypeId: 0, value: "" }; +} + +export const CreateResourceInfoInput = { + encode(message: CreateResourceInfoInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.resourceInfoTypeId !== 0) { + writer.uint32(16).int32(message.resourceInfoTypeId); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateResourceInfoInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateResourceInfoInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.resourceInfoTypeId = reader.int32(); + break; + case 3: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateResourceInfoInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + resourceInfoTypeId: isSet(object.resourceInfoTypeId) ? Number(object.resourceInfoTypeId) : 0, + value: isSet(object.value) ? String(object.value) : "", + }; + }, + + toJSON(message: CreateResourceInfoInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.resourceInfoTypeId !== undefined && (obj.resourceInfoTypeId = Math.round(message.resourceInfoTypeId)); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + create, I>>(base?: I): CreateResourceInfoInput { + return CreateResourceInfoInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateResourceInfoInput { + const message = createBaseCreateResourceInfoInput(); + message.resourceId = object.resourceId ?? 0; + message.resourceInfoTypeId = object.resourceInfoTypeId ?? 0; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseUpdateResourceInfoInput(): UpdateResourceInfoInput { + return { resourceId: 0, resourceInfoTypeId: 0, value: "" }; +} + +export const UpdateResourceInfoInput = { + encode(message: UpdateResourceInfoInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.resourceInfoTypeId !== 0) { + writer.uint32(16).int32(message.resourceInfoTypeId); + } + if (message.value !== "") { + writer.uint32(26).string(message.value); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateResourceInfoInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateResourceInfoInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.resourceInfoTypeId = reader.int32(); + break; + case 3: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateResourceInfoInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + resourceInfoTypeId: isSet(object.resourceInfoTypeId) ? Number(object.resourceInfoTypeId) : 0, + value: isSet(object.value) ? String(object.value) : "", + }; + }, + + toJSON(message: UpdateResourceInfoInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.resourceInfoTypeId !== undefined && (obj.resourceInfoTypeId = Math.round(message.resourceInfoTypeId)); + message.value !== undefined && (obj.value = message.value); + return obj; + }, + + create, I>>(base?: I): UpdateResourceInfoInput { + return UpdateResourceInfoInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UpdateResourceInfoInput { + const message = createBaseUpdateResourceInfoInput(); + message.resourceId = object.resourceId ?? 0; + message.resourceInfoTypeId = object.resourceInfoTypeId ?? 0; + message.value = object.value ?? ""; + return message; + }, +}; + +function createBaseDeleteResourceInfoInput(): DeleteResourceInfoInput { + return { resourceId: 0 }; +} + +export const DeleteResourceInfoInput = { + encode(message: DeleteResourceInfoInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteResourceInfoInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteResourceInfoInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteResourceInfoInput { + return { resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0 }; + }, + + toJSON(message: DeleteResourceInfoInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + return obj; + }, + + create, I>>(base?: I): DeleteResourceInfoInput { + return DeleteResourceInfoInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeleteResourceInfoInput { + const message = createBaseDeleteResourceInfoInput(); + message.resourceId = object.resourceId ?? 0; + return message; + }, +}; + +function createBaseGetResourceInfosInput(): GetResourceInfosInput { + return { resourceId: 0, resourceInfoTypeId: undefined }; +} + +export const GetResourceInfosInput = { + encode(message: GetResourceInfosInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.resourceInfoTypeId !== undefined) { + writer.uint32(16).int32(message.resourceInfoTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetResourceInfosInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetResourceInfosInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.resourceInfoTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetResourceInfosInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + resourceInfoTypeId: isSet(object.resourceInfoTypeId) ? Number(object.resourceInfoTypeId) : undefined, + }; + }, + + toJSON(message: GetResourceInfosInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.resourceInfoTypeId !== undefined && (obj.resourceInfoTypeId = Math.round(message.resourceInfoTypeId)); + return obj; + }, + + create, I>>(base?: I): GetResourceInfosInput { + return GetResourceInfosInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetResourceInfosInput { + const message = createBaseGetResourceInfosInput(); + message.resourceId = object.resourceId ?? 0; + message.resourceInfoTypeId = object.resourceInfoTypeId ?? undefined; + return message; + }, +}; + +function createBaseResourceInfoList(): ResourceInfoList { + return { resourceInfos: [] }; +} + +export const ResourceInfoList = { + encode(message: ResourceInfoList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.resourceInfos) { + ResourceInfo.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ResourceInfoList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseResourceInfoList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceInfos.push(ResourceInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ResourceInfoList { + return { + resourceInfos: Array.isArray(object?.resourceInfos) + ? object.resourceInfos.map((e: any) => ResourceInfo.fromJSON(e)) + : [], + }; + }, + + toJSON(message: ResourceInfoList): unknown { + const obj: any = {}; + if (message.resourceInfos) { + obj.resourceInfos = message.resourceInfos.map((e) => e ? ResourceInfo.toJSON(e) : undefined); + } else { + obj.resourceInfos = []; + } + return obj; + }, + + create, I>>(base?: I): ResourceInfoList { + return ResourceInfoList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ResourceInfoList { + const message = createBaseResourceInfoList(); + message.resourceInfos = object.resourceInfos?.map((e) => ResourceInfo.fromPartial(e)) || []; + return message; + }, +}; + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/models/domain-layer/legacy/resource_submission.ts b/src/models/domain-layer/legacy/resource_submission.ts index 9e6fb74..7ceb688 100644 --- a/src/models/domain-layer/legacy/resource_submission.ts +++ b/src/models/domain-layer/legacy/resource_submission.ts @@ -11,6 +11,11 @@ export interface ResourceSubmission { modifyDate: number; } +export interface CreateResourceSubmissionInput { + resourceId: number; + submissionId: number; +} + function createBaseResourceSubmission(): ResourceSubmission { return { resourceId: 0, submissionId: 0, createUser: 0, createDate: 0, modifyUser: 0, modifyDate: 0 }; } @@ -109,6 +114,70 @@ export const ResourceSubmission = { }, }; +function createBaseCreateResourceSubmissionInput(): CreateResourceSubmissionInput { + return { resourceId: 0, submissionId: 0 }; +} + +export const CreateResourceSubmissionInput = { + encode(message: CreateResourceSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(8).int32(message.resourceId); + } + if (message.submissionId !== 0) { + writer.uint32(16).int32(message.submissionId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateResourceSubmissionInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateResourceSubmissionInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.resourceId = reader.int32(); + break; + case 2: + message.submissionId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateResourceSubmissionInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + }; + }, + + toJSON(message: CreateResourceSubmissionInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + return obj; + }, + + create, I>>(base?: I): CreateResourceSubmissionInput { + return CreateResourceSubmissionInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): CreateResourceSubmissionInput { + const message = createBaseCreateResourceSubmissionInput(); + message.resourceId = object.resourceId ?? 0; + message.submissionId = object.submissionId ?? 0; + return message; + }, +}; + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/models/domain-layer/legacy/review.ts b/src/models/domain-layer/legacy/review.ts new file mode 100644 index 0000000..55fe9dc --- /dev/null +++ b/src/models/domain-layer/legacy/review.ts @@ -0,0 +1,2242 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export interface Review { + reviewId: number; + resourceId: number; + submissionId: number; + projectPhaseId: number; + scorecardId: number; + committed: number; + score: number; + initialScore: number; + createUser: number; + createDate: number; + modifyUser: number; + modifyDate: number; +} + +export interface ReviewList { + items: Review[]; +} + +export interface CreateReviewInput { + resourceId: number; + submissionId: number; + projectPhaseId: number; + scorecardId: number; + committed: number; + score: number; + initialScore: number; +} + +export interface ReviewItem { + reviewItemId: number; + reviewId: number; + scorecardQuestionId: number; + uploadId?: number | undefined; + answer: string; + sort: number; + createUser?: number | undefined; + createDate?: number | undefined; + modifyUser?: number | undefined; + modifyDate?: number | undefined; +} + +export interface CreateReviewItemInput { + reviewId: number; + scorecardQuestionId: number; + uploadId?: number | undefined; + answer: string; + sort: number; +} + +export interface Submission { + submissionId: number; + uploadId: number; + initialScore?: number | undefined; + finalScore?: number | undefined; + placement?: number | undefined; + prizeId?: number | undefined; + submissionStatusId: number; + submissionTypeId: number; +} + +export interface GetSubmissionInput { + projectId: number; + submissionStatusId?: number | undefined; + uploadStatusId?: number | undefined; + resourceId: number; +} + +export interface CreateSubmissionInput { + uploadId: number; + initialScore?: number | undefined; + finalScore?: number | undefined; + placement?: number | undefined; + prizeId?: number | undefined; + submissionStatusId: number; + submissionTypeId: number; +} + +export interface UpdateSubmissionInput { + submissionId: number; + initialScore?: number | undefined; + finalScore?: number | undefined; + placement?: number | undefined; + prizeId?: number | undefined; +} + +export interface Upload { + uploadId: number; + projectId: number; + uploadStatusId: number; + resourceRoleId: number; + resourceId: number; +} + +export interface CreateUploadInput { + projectId: number; + uploadStatusId: number; + resourceId: number; + projectPhaseId: number; + uploadTypeId: number; + parameter: string; +} + +export interface ReviewComment { + reviewCommentId: number; + resourceId: number; + reviewId: number; + commentTypeId: number; + content: string; +} + +export interface CreateReviewComment { + resourceId: number; + reviewId: number; + commentTypeId: number; + content: string; +} + +export interface ReviewItemComment { + reviewItemCommentId: number; + resourceId: number; + reviewItemId: number; + commentTypeId: number; + content: string; + sort: number; +} + +export interface CreateReviewItemCommentInput { + resourceId: number; + reviewItemId: number; + commentTypeId: number; + content: string; + sort: number; +} + +export interface ScorecardGroup { + scorecardGroupId: number; + scorecardId: number; + name: string; + weight: number; + sort: number; + version: number; + createUser?: number | undefined; + createDate?: number | undefined; + modifyUser?: number | undefined; + modifyDate?: number | undefined; +} + +export interface ScorecardGroupList { + items: ScorecardGroup[]; +} + +export interface GetScorecardGroupsInput { + scorecardId: number; +} + +export interface ScorecardSection { + scorecardSectionId: number; + scorecardGroupId: number; + name: string; + weight: number; + sort: number; + version: number; + createUser?: number | undefined; + createDate?: number | undefined; + modifyUser?: number | undefined; + modifyDate?: number | undefined; +} + +export interface ScorecardSectionList { + items: ScorecardSection[]; +} + +export interface GetScorecardSectionsInput { + scorecardGroupId: number; +} + +function createBaseReview(): Review { + return { + reviewId: 0, + resourceId: 0, + submissionId: 0, + projectPhaseId: 0, + scorecardId: 0, + committed: 0, + score: 0, + initialScore: 0, + createUser: 0, + createDate: 0, + modifyUser: 0, + modifyDate: 0, + }; +} + +export const Review = { + encode(message: Review, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.reviewId !== 0) { + writer.uint32(8).int32(message.reviewId); + } + if (message.resourceId !== 0) { + writer.uint32(16).int32(message.resourceId); + } + if (message.submissionId !== 0) { + writer.uint32(24).int32(message.submissionId); + } + if (message.projectPhaseId !== 0) { + writer.uint32(32).int32(message.projectPhaseId); + } + if (message.scorecardId !== 0) { + writer.uint32(40).int32(message.scorecardId); + } + if (message.committed !== 0) { + writer.uint32(48).int32(message.committed); + } + if (message.score !== 0) { + writer.uint32(61).float(message.score); + } + if (message.initialScore !== 0) { + writer.uint32(69).float(message.initialScore); + } + if (message.createUser !== 0) { + writer.uint32(72).int32(message.createUser); + } + if (message.createDate !== 0) { + writer.uint32(80).int64(message.createDate); + } + if (message.modifyUser !== 0) { + writer.uint32(88).int32(message.modifyUser); + } + if (message.modifyDate !== 0) { + writer.uint32(96).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Review { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReview(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.reviewId = reader.int32(); + break; + case 2: + message.resourceId = reader.int32(); + break; + case 3: + message.submissionId = reader.int32(); + break; + case 4: + message.projectPhaseId = reader.int32(); + break; + case 5: + message.scorecardId = reader.int32(); + break; + case 6: + message.committed = reader.int32(); + break; + case 7: + message.score = reader.float(); + break; + case 8: + message.initialScore = reader.float(); + break; + case 9: + message.createUser = reader.int32(); + break; + case 10: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 11: + message.modifyUser = reader.int32(); + break; + case 12: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Review { + return { + reviewId: isSet(object.reviewId) ? Number(object.reviewId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + scorecardId: isSet(object.scorecardId) ? Number(object.scorecardId) : 0, + committed: isSet(object.committed) ? Number(object.committed) : 0, + score: isSet(object.score) ? Number(object.score) : 0, + initialScore: isSet(object.initialScore) ? Number(object.initialScore) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + }; + }, + + toJSON(message: Review): unknown { + const obj: any = {}; + message.reviewId !== undefined && (obj.reviewId = Math.round(message.reviewId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.scorecardId !== undefined && (obj.scorecardId = Math.round(message.scorecardId)); + message.committed !== undefined && (obj.committed = Math.round(message.committed)); + message.score !== undefined && (obj.score = message.score); + message.initialScore !== undefined && (obj.initialScore = message.initialScore); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): Review { + return Review.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Review { + const message = createBaseReview(); + message.reviewId = object.reviewId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.submissionId = object.submissionId ?? 0; + message.projectPhaseId = object.projectPhaseId ?? 0; + message.scorecardId = object.scorecardId ?? 0; + message.committed = object.committed ?? 0; + message.score = object.score ?? 0; + message.initialScore = object.initialScore ?? 0; + message.createUser = object.createUser ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.modifyDate = object.modifyDate ?? 0; + return message; + }, +}; + +function createBaseReviewList(): ReviewList { + return { items: [] }; +} + +export const ReviewList = { + encode(message: ReviewList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.items) { + Review.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ReviewList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReviewList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.items.push(Review.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReviewList { + return { items: Array.isArray(object?.items) ? object.items.map((e: any) => Review.fromJSON(e)) : [] }; + }, + + toJSON(message: ReviewList): unknown { + const obj: any = {}; + if (message.items) { + obj.items = message.items.map((e) => e ? Review.toJSON(e) : undefined); + } else { + obj.items = []; + } + return obj; + }, + + create, I>>(base?: I): ReviewList { + return ReviewList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ReviewList { + const message = createBaseReviewList(); + message.items = object.items?.map((e) => Review.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCreateReviewInput(): CreateReviewInput { + return { resourceId: 0, submissionId: 0, projectPhaseId: 0, scorecardId: 0, committed: 0, score: 0, initialScore: 0 }; +} + +export const CreateReviewInput = { + encode(message: CreateReviewInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(16).int32(message.resourceId); + } + if (message.submissionId !== 0) { + writer.uint32(24).int32(message.submissionId); + } + if (message.projectPhaseId !== 0) { + writer.uint32(32).int32(message.projectPhaseId); + } + if (message.scorecardId !== 0) { + writer.uint32(40).int32(message.scorecardId); + } + if (message.committed !== 0) { + writer.uint32(48).int32(message.committed); + } + if (message.score !== 0) { + writer.uint32(61).float(message.score); + } + if (message.initialScore !== 0) { + writer.uint32(69).float(message.initialScore); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateReviewInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateReviewInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.resourceId = reader.int32(); + break; + case 3: + message.submissionId = reader.int32(); + break; + case 4: + message.projectPhaseId = reader.int32(); + break; + case 5: + message.scorecardId = reader.int32(); + break; + case 6: + message.committed = reader.int32(); + break; + case 7: + message.score = reader.float(); + break; + case 8: + message.initialScore = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateReviewInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + scorecardId: isSet(object.scorecardId) ? Number(object.scorecardId) : 0, + committed: isSet(object.committed) ? Number(object.committed) : 0, + score: isSet(object.score) ? Number(object.score) : 0, + initialScore: isSet(object.initialScore) ? Number(object.initialScore) : 0, + }; + }, + + toJSON(message: CreateReviewInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.scorecardId !== undefined && (obj.scorecardId = Math.round(message.scorecardId)); + message.committed !== undefined && (obj.committed = Math.round(message.committed)); + message.score !== undefined && (obj.score = message.score); + message.initialScore !== undefined && (obj.initialScore = message.initialScore); + return obj; + }, + + create, I>>(base?: I): CreateReviewInput { + return CreateReviewInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateReviewInput { + const message = createBaseCreateReviewInput(); + message.resourceId = object.resourceId ?? 0; + message.submissionId = object.submissionId ?? 0; + message.projectPhaseId = object.projectPhaseId ?? 0; + message.scorecardId = object.scorecardId ?? 0; + message.committed = object.committed ?? 0; + message.score = object.score ?? 0; + message.initialScore = object.initialScore ?? 0; + return message; + }, +}; + +function createBaseReviewItem(): ReviewItem { + return { + reviewItemId: 0, + reviewId: 0, + scorecardQuestionId: 0, + uploadId: undefined, + answer: "", + sort: 0, + createUser: undefined, + createDate: undefined, + modifyUser: undefined, + modifyDate: undefined, + }; +} + +export const ReviewItem = { + encode(message: ReviewItem, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.reviewItemId !== 0) { + writer.uint32(8).int32(message.reviewItemId); + } + if (message.reviewId !== 0) { + writer.uint32(16).int32(message.reviewId); + } + if (message.scorecardQuestionId !== 0) { + writer.uint32(24).int32(message.scorecardQuestionId); + } + if (message.uploadId !== undefined) { + writer.uint32(32).int32(message.uploadId); + } + if (message.answer !== "") { + writer.uint32(42).string(message.answer); + } + if (message.sort !== 0) { + writer.uint32(48).int32(message.sort); + } + if (message.createUser !== undefined) { + writer.uint32(56).int32(message.createUser); + } + if (message.createDate !== undefined) { + writer.uint32(64).int64(message.createDate); + } + if (message.modifyUser !== undefined) { + writer.uint32(72).int32(message.modifyUser); + } + if (message.modifyDate !== undefined) { + writer.uint32(80).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ReviewItem { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReviewItem(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.reviewItemId = reader.int32(); + break; + case 2: + message.reviewId = reader.int32(); + break; + case 3: + message.scorecardQuestionId = reader.int32(); + break; + case 4: + message.uploadId = reader.int32(); + break; + case 5: + message.answer = reader.string(); + break; + case 6: + message.sort = reader.int32(); + break; + case 7: + message.createUser = reader.int32(); + break; + case 8: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 9: + message.modifyUser = reader.int32(); + break; + case 10: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReviewItem { + return { + reviewItemId: isSet(object.reviewItemId) ? Number(object.reviewItemId) : 0, + reviewId: isSet(object.reviewId) ? Number(object.reviewId) : 0, + scorecardQuestionId: isSet(object.scorecardQuestionId) ? Number(object.scorecardQuestionId) : 0, + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : undefined, + answer: isSet(object.answer) ? String(object.answer) : "", + sort: isSet(object.sort) ? Number(object.sort) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : undefined, + createDate: isSet(object.createDate) ? Number(object.createDate) : undefined, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : undefined, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : undefined, + }; + }, + + toJSON(message: ReviewItem): unknown { + const obj: any = {}; + message.reviewItemId !== undefined && (obj.reviewItemId = Math.round(message.reviewItemId)); + message.reviewId !== undefined && (obj.reviewId = Math.round(message.reviewId)); + message.scorecardQuestionId !== undefined && (obj.scorecardQuestionId = Math.round(message.scorecardQuestionId)); + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.answer !== undefined && (obj.answer = message.answer); + message.sort !== undefined && (obj.sort = Math.round(message.sort)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): ReviewItem { + return ReviewItem.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ReviewItem { + const message = createBaseReviewItem(); + message.reviewItemId = object.reviewItemId ?? 0; + message.reviewId = object.reviewId ?? 0; + message.scorecardQuestionId = object.scorecardQuestionId ?? 0; + message.uploadId = object.uploadId ?? undefined; + message.answer = object.answer ?? ""; + message.sort = object.sort ?? 0; + message.createUser = object.createUser ?? undefined; + message.createDate = object.createDate ?? undefined; + message.modifyUser = object.modifyUser ?? undefined; + message.modifyDate = object.modifyDate ?? undefined; + return message; + }, +}; + +function createBaseCreateReviewItemInput(): CreateReviewItemInput { + return { reviewId: 0, scorecardQuestionId: 0, uploadId: undefined, answer: "", sort: 0 }; +} + +export const CreateReviewItemInput = { + encode(message: CreateReviewItemInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.reviewId !== 0) { + writer.uint32(16).int32(message.reviewId); + } + if (message.scorecardQuestionId !== 0) { + writer.uint32(24).int32(message.scorecardQuestionId); + } + if (message.uploadId !== undefined) { + writer.uint32(32).int32(message.uploadId); + } + if (message.answer !== "") { + writer.uint32(42).string(message.answer); + } + if (message.sort !== 0) { + writer.uint32(48).int32(message.sort); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateReviewItemInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateReviewItemInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.reviewId = reader.int32(); + break; + case 3: + message.scorecardQuestionId = reader.int32(); + break; + case 4: + message.uploadId = reader.int32(); + break; + case 5: + message.answer = reader.string(); + break; + case 6: + message.sort = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateReviewItemInput { + return { + reviewId: isSet(object.reviewId) ? Number(object.reviewId) : 0, + scorecardQuestionId: isSet(object.scorecardQuestionId) ? Number(object.scorecardQuestionId) : 0, + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : undefined, + answer: isSet(object.answer) ? String(object.answer) : "", + sort: isSet(object.sort) ? Number(object.sort) : 0, + }; + }, + + toJSON(message: CreateReviewItemInput): unknown { + const obj: any = {}; + message.reviewId !== undefined && (obj.reviewId = Math.round(message.reviewId)); + message.scorecardQuestionId !== undefined && (obj.scorecardQuestionId = Math.round(message.scorecardQuestionId)); + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.answer !== undefined && (obj.answer = message.answer); + message.sort !== undefined && (obj.sort = Math.round(message.sort)); + return obj; + }, + + create, I>>(base?: I): CreateReviewItemInput { + return CreateReviewItemInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateReviewItemInput { + const message = createBaseCreateReviewItemInput(); + message.reviewId = object.reviewId ?? 0; + message.scorecardQuestionId = object.scorecardQuestionId ?? 0; + message.uploadId = object.uploadId ?? undefined; + message.answer = object.answer ?? ""; + message.sort = object.sort ?? 0; + return message; + }, +}; + +function createBaseSubmission(): Submission { + return { + submissionId: 0, + uploadId: 0, + initialScore: undefined, + finalScore: undefined, + placement: undefined, + prizeId: undefined, + submissionStatusId: 0, + submissionTypeId: 0, + }; +} + +export const Submission = { + encode(message: Submission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.submissionId !== 0) { + writer.uint32(8).int32(message.submissionId); + } + if (message.uploadId !== 0) { + writer.uint32(16).int32(message.uploadId); + } + if (message.initialScore !== undefined) { + writer.uint32(24).int32(message.initialScore); + } + if (message.finalScore !== undefined) { + writer.uint32(32).int32(message.finalScore); + } + if (message.placement !== undefined) { + writer.uint32(40).int32(message.placement); + } + if (message.prizeId !== undefined) { + writer.uint32(48).int32(message.prizeId); + } + if (message.submissionStatusId !== 0) { + writer.uint32(56).int32(message.submissionStatusId); + } + if (message.submissionTypeId !== 0) { + writer.uint32(64).int32(message.submissionTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Submission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubmission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submissionId = reader.int32(); + break; + case 2: + message.uploadId = reader.int32(); + break; + case 3: + message.initialScore = reader.int32(); + break; + case 4: + message.finalScore = reader.int32(); + break; + case 5: + message.placement = reader.int32(); + break; + case 6: + message.prizeId = reader.int32(); + break; + case 7: + message.submissionStatusId = reader.int32(); + break; + case 8: + message.submissionTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Submission { + return { + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + initialScore: isSet(object.initialScore) ? Number(object.initialScore) : undefined, + finalScore: isSet(object.finalScore) ? Number(object.finalScore) : undefined, + placement: isSet(object.placement) ? Number(object.placement) : undefined, + prizeId: isSet(object.prizeId) ? Number(object.prizeId) : undefined, + submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, + submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, + }; + }, + + toJSON(message: Submission): unknown { + const obj: any = {}; + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.initialScore !== undefined && (obj.initialScore = Math.round(message.initialScore)); + message.finalScore !== undefined && (obj.finalScore = Math.round(message.finalScore)); + message.placement !== undefined && (obj.placement = Math.round(message.placement)); + message.prizeId !== undefined && (obj.prizeId = Math.round(message.prizeId)); + message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); + message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); + return obj; + }, + + create, I>>(base?: I): Submission { + return Submission.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Submission { + const message = createBaseSubmission(); + message.submissionId = object.submissionId ?? 0; + message.uploadId = object.uploadId ?? 0; + message.initialScore = object.initialScore ?? undefined; + message.finalScore = object.finalScore ?? undefined; + message.placement = object.placement ?? undefined; + message.prizeId = object.prizeId ?? undefined; + message.submissionStatusId = object.submissionStatusId ?? 0; + message.submissionTypeId = object.submissionTypeId ?? 0; + return message; + }, +}; + +function createBaseGetSubmissionInput(): GetSubmissionInput { + return { projectId: 0, submissionStatusId: undefined, uploadStatusId: undefined, resourceId: 0 }; +} + +export const GetSubmissionInput = { + encode(message: GetSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.submissionStatusId !== undefined) { + writer.uint32(16).int32(message.submissionStatusId); + } + if (message.uploadStatusId !== undefined) { + writer.uint32(24).int32(message.uploadStatusId); + } + if (message.resourceId !== 0) { + writer.uint32(32).int32(message.resourceId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetSubmissionInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetSubmissionInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.submissionStatusId = reader.int32(); + break; + case 3: + message.uploadStatusId = reader.int32(); + break; + case 4: + message.resourceId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetSubmissionInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : undefined, + uploadStatusId: isSet(object.uploadStatusId) ? Number(object.uploadStatusId) : undefined, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + }; + }, + + toJSON(message: GetSubmissionInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); + message.uploadStatusId !== undefined && (obj.uploadStatusId = Math.round(message.uploadStatusId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + return obj; + }, + + create, I>>(base?: I): GetSubmissionInput { + return GetSubmissionInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetSubmissionInput { + const message = createBaseGetSubmissionInput(); + message.projectId = object.projectId ?? 0; + message.submissionStatusId = object.submissionStatusId ?? undefined; + message.uploadStatusId = object.uploadStatusId ?? undefined; + message.resourceId = object.resourceId ?? 0; + return message; + }, +}; + +function createBaseCreateSubmissionInput(): CreateSubmissionInput { + return { + uploadId: 0, + initialScore: undefined, + finalScore: undefined, + placement: undefined, + prizeId: undefined, + submissionStatusId: 0, + submissionTypeId: 0, + }; +} + +export const CreateSubmissionInput = { + encode(message: CreateSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.uploadId !== 0) { + writer.uint32(8).int32(message.uploadId); + } + if (message.initialScore !== undefined) { + writer.uint32(16).int32(message.initialScore); + } + if (message.finalScore !== undefined) { + writer.uint32(24).int32(message.finalScore); + } + if (message.placement !== undefined) { + writer.uint32(32).int32(message.placement); + } + if (message.prizeId !== undefined) { + writer.uint32(40).int32(message.prizeId); + } + if (message.submissionStatusId !== 0) { + writer.uint32(48).int32(message.submissionStatusId); + } + if (message.submissionTypeId !== 0) { + writer.uint32(56).int32(message.submissionTypeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateSubmissionInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateSubmissionInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uploadId = reader.int32(); + break; + case 2: + message.initialScore = reader.int32(); + break; + case 3: + message.finalScore = reader.int32(); + break; + case 4: + message.placement = reader.int32(); + break; + case 5: + message.prizeId = reader.int32(); + break; + case 6: + message.submissionStatusId = reader.int32(); + break; + case 7: + message.submissionTypeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateSubmissionInput { + return { + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + initialScore: isSet(object.initialScore) ? Number(object.initialScore) : undefined, + finalScore: isSet(object.finalScore) ? Number(object.finalScore) : undefined, + placement: isSet(object.placement) ? Number(object.placement) : undefined, + prizeId: isSet(object.prizeId) ? Number(object.prizeId) : undefined, + submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, + submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, + }; + }, + + toJSON(message: CreateSubmissionInput): unknown { + const obj: any = {}; + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.initialScore !== undefined && (obj.initialScore = Math.round(message.initialScore)); + message.finalScore !== undefined && (obj.finalScore = Math.round(message.finalScore)); + message.placement !== undefined && (obj.placement = Math.round(message.placement)); + message.prizeId !== undefined && (obj.prizeId = Math.round(message.prizeId)); + message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); + message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); + return obj; + }, + + create, I>>(base?: I): CreateSubmissionInput { + return CreateSubmissionInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateSubmissionInput { + const message = createBaseCreateSubmissionInput(); + message.uploadId = object.uploadId ?? 0; + message.initialScore = object.initialScore ?? undefined; + message.finalScore = object.finalScore ?? undefined; + message.placement = object.placement ?? undefined; + message.prizeId = object.prizeId ?? undefined; + message.submissionStatusId = object.submissionStatusId ?? 0; + message.submissionTypeId = object.submissionTypeId ?? 0; + return message; + }, +}; + +function createBaseUpdateSubmissionInput(): UpdateSubmissionInput { + return { submissionId: 0, initialScore: undefined, finalScore: undefined, placement: undefined, prizeId: undefined }; +} + +export const UpdateSubmissionInput = { + encode(message: UpdateSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.submissionId !== 0) { + writer.uint32(8).int32(message.submissionId); + } + if (message.initialScore !== undefined) { + writer.uint32(24).int32(message.initialScore); + } + if (message.finalScore !== undefined) { + writer.uint32(32).int32(message.finalScore); + } + if (message.placement !== undefined) { + writer.uint32(40).int32(message.placement); + } + if (message.prizeId !== undefined) { + writer.uint32(48).int32(message.prizeId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSubmissionInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateSubmissionInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submissionId = reader.int32(); + break; + case 3: + message.initialScore = reader.int32(); + break; + case 4: + message.finalScore = reader.int32(); + break; + case 5: + message.placement = reader.int32(); + break; + case 6: + message.prizeId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateSubmissionInput { + return { + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + initialScore: isSet(object.initialScore) ? Number(object.initialScore) : undefined, + finalScore: isSet(object.finalScore) ? Number(object.finalScore) : undefined, + placement: isSet(object.placement) ? Number(object.placement) : undefined, + prizeId: isSet(object.prizeId) ? Number(object.prizeId) : undefined, + }; + }, + + toJSON(message: UpdateSubmissionInput): unknown { + const obj: any = {}; + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.initialScore !== undefined && (obj.initialScore = Math.round(message.initialScore)); + message.finalScore !== undefined && (obj.finalScore = Math.round(message.finalScore)); + message.placement !== undefined && (obj.placement = Math.round(message.placement)); + message.prizeId !== undefined && (obj.prizeId = Math.round(message.prizeId)); + return obj; + }, + + create, I>>(base?: I): UpdateSubmissionInput { + return UpdateSubmissionInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UpdateSubmissionInput { + const message = createBaseUpdateSubmissionInput(); + message.submissionId = object.submissionId ?? 0; + message.initialScore = object.initialScore ?? undefined; + message.finalScore = object.finalScore ?? undefined; + message.placement = object.placement ?? undefined; + message.prizeId = object.prizeId ?? undefined; + return message; + }, +}; + +function createBaseUpload(): Upload { + return { uploadId: 0, projectId: 0, uploadStatusId: 0, resourceRoleId: 0, resourceId: 0 }; +} + +export const Upload = { + encode(message: Upload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.uploadId !== 0) { + writer.uint32(8).int32(message.uploadId); + } + if (message.projectId !== 0) { + writer.uint32(16).int32(message.projectId); + } + if (message.uploadStatusId !== 0) { + writer.uint32(24).int32(message.uploadStatusId); + } + if (message.resourceRoleId !== 0) { + writer.uint32(32).int32(message.resourceRoleId); + } + if (message.resourceId !== 0) { + writer.uint32(40).int32(message.resourceId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Upload { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uploadId = reader.int32(); + break; + case 2: + message.projectId = reader.int32(); + break; + case 3: + message.uploadStatusId = reader.int32(); + break; + case 4: + message.resourceRoleId = reader.int32(); + break; + case 5: + message.resourceId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Upload { + return { + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + uploadStatusId: isSet(object.uploadStatusId) ? Number(object.uploadStatusId) : 0, + resourceRoleId: isSet(object.resourceRoleId) ? Number(object.resourceRoleId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + }; + }, + + toJSON(message: Upload): unknown { + const obj: any = {}; + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.uploadStatusId !== undefined && (obj.uploadStatusId = Math.round(message.uploadStatusId)); + message.resourceRoleId !== undefined && (obj.resourceRoleId = Math.round(message.resourceRoleId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + return obj; + }, + + create, I>>(base?: I): Upload { + return Upload.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Upload { + const message = createBaseUpload(); + message.uploadId = object.uploadId ?? 0; + message.projectId = object.projectId ?? 0; + message.uploadStatusId = object.uploadStatusId ?? 0; + message.resourceRoleId = object.resourceRoleId ?? 0; + message.resourceId = object.resourceId ?? 0; + return message; + }, +}; + +function createBaseCreateUploadInput(): CreateUploadInput { + return { projectId: 0, uploadStatusId: 0, resourceId: 0, projectPhaseId: 0, uploadTypeId: 0, parameter: "" }; +} + +export const CreateUploadInput = { + encode(message: CreateUploadInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(16).int32(message.projectId); + } + if (message.uploadStatusId !== 0) { + writer.uint32(24).int32(message.uploadStatusId); + } + if (message.resourceId !== 0) { + writer.uint32(32).int32(message.resourceId); + } + if (message.projectPhaseId !== 0) { + writer.uint32(40).int32(message.projectPhaseId); + } + if (message.uploadTypeId !== 0) { + writer.uint32(48).int32(message.uploadTypeId); + } + if (message.parameter !== "") { + writer.uint32(58).string(message.parameter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateUploadInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateUploadInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.projectId = reader.int32(); + break; + case 3: + message.uploadStatusId = reader.int32(); + break; + case 4: + message.resourceId = reader.int32(); + break; + case 5: + message.projectPhaseId = reader.int32(); + break; + case 6: + message.uploadTypeId = reader.int32(); + break; + case 7: + message.parameter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateUploadInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + uploadStatusId: isSet(object.uploadStatusId) ? Number(object.uploadStatusId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + uploadTypeId: isSet(object.uploadTypeId) ? Number(object.uploadTypeId) : 0, + parameter: isSet(object.parameter) ? String(object.parameter) : "", + }; + }, + + toJSON(message: CreateUploadInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.uploadStatusId !== undefined && (obj.uploadStatusId = Math.round(message.uploadStatusId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.uploadTypeId !== undefined && (obj.uploadTypeId = Math.round(message.uploadTypeId)); + message.parameter !== undefined && (obj.parameter = message.parameter); + return obj; + }, + + create, I>>(base?: I): CreateUploadInput { + return CreateUploadInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateUploadInput { + const message = createBaseCreateUploadInput(); + message.projectId = object.projectId ?? 0; + message.uploadStatusId = object.uploadStatusId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.projectPhaseId = object.projectPhaseId ?? 0; + message.uploadTypeId = object.uploadTypeId ?? 0; + message.parameter = object.parameter ?? ""; + return message; + }, +}; + +function createBaseReviewComment(): ReviewComment { + return { reviewCommentId: 0, resourceId: 0, reviewId: 0, commentTypeId: 0, content: "" }; +} + +export const ReviewComment = { + encode(message: ReviewComment, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.reviewCommentId !== 0) { + writer.uint32(8).int32(message.reviewCommentId); + } + if (message.resourceId !== 0) { + writer.uint32(16).int32(message.resourceId); + } + if (message.reviewId !== 0) { + writer.uint32(24).int32(message.reviewId); + } + if (message.commentTypeId !== 0) { + writer.uint32(32).int32(message.commentTypeId); + } + if (message.content !== "") { + writer.uint32(42).string(message.content); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ReviewComment { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReviewComment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.reviewCommentId = reader.int32(); + break; + case 2: + message.resourceId = reader.int32(); + break; + case 3: + message.reviewId = reader.int32(); + break; + case 4: + message.commentTypeId = reader.int32(); + break; + case 5: + message.content = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReviewComment { + return { + reviewCommentId: isSet(object.reviewCommentId) ? Number(object.reviewCommentId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + reviewId: isSet(object.reviewId) ? Number(object.reviewId) : 0, + commentTypeId: isSet(object.commentTypeId) ? Number(object.commentTypeId) : 0, + content: isSet(object.content) ? String(object.content) : "", + }; + }, + + toJSON(message: ReviewComment): unknown { + const obj: any = {}; + message.reviewCommentId !== undefined && (obj.reviewCommentId = Math.round(message.reviewCommentId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.reviewId !== undefined && (obj.reviewId = Math.round(message.reviewId)); + message.commentTypeId !== undefined && (obj.commentTypeId = Math.round(message.commentTypeId)); + message.content !== undefined && (obj.content = message.content); + return obj; + }, + + create, I>>(base?: I): ReviewComment { + return ReviewComment.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ReviewComment { + const message = createBaseReviewComment(); + message.reviewCommentId = object.reviewCommentId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.reviewId = object.reviewId ?? 0; + message.commentTypeId = object.commentTypeId ?? 0; + message.content = object.content ?? ""; + return message; + }, +}; + +function createBaseCreateReviewComment(): CreateReviewComment { + return { resourceId: 0, reviewId: 0, commentTypeId: 0, content: "" }; +} + +export const CreateReviewComment = { + encode(message: CreateReviewComment, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(16).int32(message.resourceId); + } + if (message.reviewId !== 0) { + writer.uint32(24).int32(message.reviewId); + } + if (message.commentTypeId !== 0) { + writer.uint32(32).int32(message.commentTypeId); + } + if (message.content !== "") { + writer.uint32(42).string(message.content); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateReviewComment { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateReviewComment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.resourceId = reader.int32(); + break; + case 3: + message.reviewId = reader.int32(); + break; + case 4: + message.commentTypeId = reader.int32(); + break; + case 5: + message.content = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateReviewComment { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + reviewId: isSet(object.reviewId) ? Number(object.reviewId) : 0, + commentTypeId: isSet(object.commentTypeId) ? Number(object.commentTypeId) : 0, + content: isSet(object.content) ? String(object.content) : "", + }; + }, + + toJSON(message: CreateReviewComment): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.reviewId !== undefined && (obj.reviewId = Math.round(message.reviewId)); + message.commentTypeId !== undefined && (obj.commentTypeId = Math.round(message.commentTypeId)); + message.content !== undefined && (obj.content = message.content); + return obj; + }, + + create, I>>(base?: I): CreateReviewComment { + return CreateReviewComment.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateReviewComment { + const message = createBaseCreateReviewComment(); + message.resourceId = object.resourceId ?? 0; + message.reviewId = object.reviewId ?? 0; + message.commentTypeId = object.commentTypeId ?? 0; + message.content = object.content ?? ""; + return message; + }, +}; + +function createBaseReviewItemComment(): ReviewItemComment { + return { reviewItemCommentId: 0, resourceId: 0, reviewItemId: 0, commentTypeId: 0, content: "", sort: 0 }; +} + +export const ReviewItemComment = { + encode(message: ReviewItemComment, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.reviewItemCommentId !== 0) { + writer.uint32(8).int32(message.reviewItemCommentId); + } + if (message.resourceId !== 0) { + writer.uint32(16).int32(message.resourceId); + } + if (message.reviewItemId !== 0) { + writer.uint32(24).int32(message.reviewItemId); + } + if (message.commentTypeId !== 0) { + writer.uint32(32).int32(message.commentTypeId); + } + if (message.content !== "") { + writer.uint32(42).string(message.content); + } + if (message.sort !== 0) { + writer.uint32(48).int32(message.sort); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ReviewItemComment { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseReviewItemComment(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.reviewItemCommentId = reader.int32(); + break; + case 2: + message.resourceId = reader.int32(); + break; + case 3: + message.reviewItemId = reader.int32(); + break; + case 4: + message.commentTypeId = reader.int32(); + break; + case 5: + message.content = reader.string(); + break; + case 6: + message.sort = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ReviewItemComment { + return { + reviewItemCommentId: isSet(object.reviewItemCommentId) ? Number(object.reviewItemCommentId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + reviewItemId: isSet(object.reviewItemId) ? Number(object.reviewItemId) : 0, + commentTypeId: isSet(object.commentTypeId) ? Number(object.commentTypeId) : 0, + content: isSet(object.content) ? String(object.content) : "", + sort: isSet(object.sort) ? Number(object.sort) : 0, + }; + }, + + toJSON(message: ReviewItemComment): unknown { + const obj: any = {}; + message.reviewItemCommentId !== undefined && (obj.reviewItemCommentId = Math.round(message.reviewItemCommentId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.reviewItemId !== undefined && (obj.reviewItemId = Math.round(message.reviewItemId)); + message.commentTypeId !== undefined && (obj.commentTypeId = Math.round(message.commentTypeId)); + message.content !== undefined && (obj.content = message.content); + message.sort !== undefined && (obj.sort = Math.round(message.sort)); + return obj; + }, + + create, I>>(base?: I): ReviewItemComment { + return ReviewItemComment.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ReviewItemComment { + const message = createBaseReviewItemComment(); + message.reviewItemCommentId = object.reviewItemCommentId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.reviewItemId = object.reviewItemId ?? 0; + message.commentTypeId = object.commentTypeId ?? 0; + message.content = object.content ?? ""; + message.sort = object.sort ?? 0; + return message; + }, +}; + +function createBaseCreateReviewItemCommentInput(): CreateReviewItemCommentInput { + return { resourceId: 0, reviewItemId: 0, commentTypeId: 0, content: "", sort: 0 }; +} + +export const CreateReviewItemCommentInput = { + encode(message: CreateReviewItemCommentInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.resourceId !== 0) { + writer.uint32(16).int32(message.resourceId); + } + if (message.reviewItemId !== 0) { + writer.uint32(24).int32(message.reviewItemId); + } + if (message.commentTypeId !== 0) { + writer.uint32(32).int32(message.commentTypeId); + } + if (message.content !== "") { + writer.uint32(42).string(message.content); + } + if (message.sort !== 0) { + writer.uint32(48).int32(message.sort); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateReviewItemCommentInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateReviewItemCommentInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.resourceId = reader.int32(); + break; + case 3: + message.reviewItemId = reader.int32(); + break; + case 4: + message.commentTypeId = reader.int32(); + break; + case 5: + message.content = reader.string(); + break; + case 6: + message.sort = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateReviewItemCommentInput { + return { + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + reviewItemId: isSet(object.reviewItemId) ? Number(object.reviewItemId) : 0, + commentTypeId: isSet(object.commentTypeId) ? Number(object.commentTypeId) : 0, + content: isSet(object.content) ? String(object.content) : "", + sort: isSet(object.sort) ? Number(object.sort) : 0, + }; + }, + + toJSON(message: CreateReviewItemCommentInput): unknown { + const obj: any = {}; + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.reviewItemId !== undefined && (obj.reviewItemId = Math.round(message.reviewItemId)); + message.commentTypeId !== undefined && (obj.commentTypeId = Math.round(message.commentTypeId)); + message.content !== undefined && (obj.content = message.content); + message.sort !== undefined && (obj.sort = Math.round(message.sort)); + return obj; + }, + + create, I>>(base?: I): CreateReviewItemCommentInput { + return CreateReviewItemCommentInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateReviewItemCommentInput { + const message = createBaseCreateReviewItemCommentInput(); + message.resourceId = object.resourceId ?? 0; + message.reviewItemId = object.reviewItemId ?? 0; + message.commentTypeId = object.commentTypeId ?? 0; + message.content = object.content ?? ""; + message.sort = object.sort ?? 0; + return message; + }, +}; + +function createBaseScorecardGroup(): ScorecardGroup { + return { + scorecardGroupId: 0, + scorecardId: 0, + name: "", + weight: 0, + sort: 0, + version: 0, + createUser: undefined, + createDate: undefined, + modifyUser: undefined, + modifyDate: undefined, + }; +} + +export const ScorecardGroup = { + encode(message: ScorecardGroup, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.scorecardGroupId !== 0) { + writer.uint32(8).int32(message.scorecardGroupId); + } + if (message.scorecardId !== 0) { + writer.uint32(16).int32(message.scorecardId); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.weight !== 0) { + writer.uint32(37).float(message.weight); + } + if (message.sort !== 0) { + writer.uint32(40).int32(message.sort); + } + if (message.version !== 0) { + writer.uint32(48).int32(message.version); + } + if (message.createUser !== undefined) { + writer.uint32(72).int32(message.createUser); + } + if (message.createDate !== undefined) { + writer.uint32(80).int64(message.createDate); + } + if (message.modifyUser !== undefined) { + writer.uint32(88).int32(message.modifyUser); + } + if (message.modifyDate !== undefined) { + writer.uint32(96).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScorecardGroup { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScorecardGroup(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scorecardGroupId = reader.int32(); + break; + case 2: + message.scorecardId = reader.int32(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.weight = reader.float(); + break; + case 5: + message.sort = reader.int32(); + break; + case 6: + message.version = reader.int32(); + break; + case 9: + message.createUser = reader.int32(); + break; + case 10: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 11: + message.modifyUser = reader.int32(); + break; + case 12: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScorecardGroup { + return { + scorecardGroupId: isSet(object.scorecardGroupId) ? Number(object.scorecardGroupId) : 0, + scorecardId: isSet(object.scorecardId) ? Number(object.scorecardId) : 0, + name: isSet(object.name) ? String(object.name) : "", + weight: isSet(object.weight) ? Number(object.weight) : 0, + sort: isSet(object.sort) ? Number(object.sort) : 0, + version: isSet(object.version) ? Number(object.version) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : undefined, + createDate: isSet(object.createDate) ? Number(object.createDate) : undefined, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : undefined, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : undefined, + }; + }, + + toJSON(message: ScorecardGroup): unknown { + const obj: any = {}; + message.scorecardGroupId !== undefined && (obj.scorecardGroupId = Math.round(message.scorecardGroupId)); + message.scorecardId !== undefined && (obj.scorecardId = Math.round(message.scorecardId)); + message.name !== undefined && (obj.name = message.name); + message.weight !== undefined && (obj.weight = message.weight); + message.sort !== undefined && (obj.sort = Math.round(message.sort)); + message.version !== undefined && (obj.version = Math.round(message.version)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): ScorecardGroup { + return ScorecardGroup.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ScorecardGroup { + const message = createBaseScorecardGroup(); + message.scorecardGroupId = object.scorecardGroupId ?? 0; + message.scorecardId = object.scorecardId ?? 0; + message.name = object.name ?? ""; + message.weight = object.weight ?? 0; + message.sort = object.sort ?? 0; + message.version = object.version ?? 0; + message.createUser = object.createUser ?? undefined; + message.createDate = object.createDate ?? undefined; + message.modifyUser = object.modifyUser ?? undefined; + message.modifyDate = object.modifyDate ?? undefined; + return message; + }, +}; + +function createBaseScorecardGroupList(): ScorecardGroupList { + return { items: [] }; +} + +export const ScorecardGroupList = { + encode(message: ScorecardGroupList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.items) { + ScorecardGroup.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScorecardGroupList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScorecardGroupList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.items.push(ScorecardGroup.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScorecardGroupList { + return { items: Array.isArray(object?.items) ? object.items.map((e: any) => ScorecardGroup.fromJSON(e)) : [] }; + }, + + toJSON(message: ScorecardGroupList): unknown { + const obj: any = {}; + if (message.items) { + obj.items = message.items.map((e) => e ? ScorecardGroup.toJSON(e) : undefined); + } else { + obj.items = []; + } + return obj; + }, + + create, I>>(base?: I): ScorecardGroupList { + return ScorecardGroupList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ScorecardGroupList { + const message = createBaseScorecardGroupList(); + message.items = object.items?.map((e) => ScorecardGroup.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGetScorecardGroupsInput(): GetScorecardGroupsInput { + return { scorecardId: 0 }; +} + +export const GetScorecardGroupsInput = { + encode(message: GetScorecardGroupsInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.scorecardId !== 0) { + writer.uint32(8).int32(message.scorecardId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetScorecardGroupsInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetScorecardGroupsInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scorecardId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetScorecardGroupsInput { + return { scorecardId: isSet(object.scorecardId) ? Number(object.scorecardId) : 0 }; + }, + + toJSON(message: GetScorecardGroupsInput): unknown { + const obj: any = {}; + message.scorecardId !== undefined && (obj.scorecardId = Math.round(message.scorecardId)); + return obj; + }, + + create, I>>(base?: I): GetScorecardGroupsInput { + return GetScorecardGroupsInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetScorecardGroupsInput { + const message = createBaseGetScorecardGroupsInput(); + message.scorecardId = object.scorecardId ?? 0; + return message; + }, +}; + +function createBaseScorecardSection(): ScorecardSection { + return { + scorecardSectionId: 0, + scorecardGroupId: 0, + name: "", + weight: 0, + sort: 0, + version: 0, + createUser: undefined, + createDate: undefined, + modifyUser: undefined, + modifyDate: undefined, + }; +} + +export const ScorecardSection = { + encode(message: ScorecardSection, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.scorecardSectionId !== 0) { + writer.uint32(8).int32(message.scorecardSectionId); + } + if (message.scorecardGroupId !== 0) { + writer.uint32(16).int32(message.scorecardGroupId); + } + if (message.name !== "") { + writer.uint32(26).string(message.name); + } + if (message.weight !== 0) { + writer.uint32(37).float(message.weight); + } + if (message.sort !== 0) { + writer.uint32(40).int32(message.sort); + } + if (message.version !== 0) { + writer.uint32(48).int32(message.version); + } + if (message.createUser !== undefined) { + writer.uint32(72).int32(message.createUser); + } + if (message.createDate !== undefined) { + writer.uint32(80).int64(message.createDate); + } + if (message.modifyUser !== undefined) { + writer.uint32(88).int32(message.modifyUser); + } + if (message.modifyDate !== undefined) { + writer.uint32(96).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScorecardSection { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScorecardSection(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scorecardSectionId = reader.int32(); + break; + case 2: + message.scorecardGroupId = reader.int32(); + break; + case 3: + message.name = reader.string(); + break; + case 4: + message.weight = reader.float(); + break; + case 5: + message.sort = reader.int32(); + break; + case 6: + message.version = reader.int32(); + break; + case 9: + message.createUser = reader.int32(); + break; + case 10: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 11: + message.modifyUser = reader.int32(); + break; + case 12: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScorecardSection { + return { + scorecardSectionId: isSet(object.scorecardSectionId) ? Number(object.scorecardSectionId) : 0, + scorecardGroupId: isSet(object.scorecardGroupId) ? Number(object.scorecardGroupId) : 0, + name: isSet(object.name) ? String(object.name) : "", + weight: isSet(object.weight) ? Number(object.weight) : 0, + sort: isSet(object.sort) ? Number(object.sort) : 0, + version: isSet(object.version) ? Number(object.version) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : undefined, + createDate: isSet(object.createDate) ? Number(object.createDate) : undefined, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : undefined, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : undefined, + }; + }, + + toJSON(message: ScorecardSection): unknown { + const obj: any = {}; + message.scorecardSectionId !== undefined && (obj.scorecardSectionId = Math.round(message.scorecardSectionId)); + message.scorecardGroupId !== undefined && (obj.scorecardGroupId = Math.round(message.scorecardGroupId)); + message.name !== undefined && (obj.name = message.name); + message.weight !== undefined && (obj.weight = message.weight); + message.sort !== undefined && (obj.sort = Math.round(message.sort)); + message.version !== undefined && (obj.version = Math.round(message.version)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): ScorecardSection { + return ScorecardSection.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ScorecardSection { + const message = createBaseScorecardSection(); + message.scorecardSectionId = object.scorecardSectionId ?? 0; + message.scorecardGroupId = object.scorecardGroupId ?? 0; + message.name = object.name ?? ""; + message.weight = object.weight ?? 0; + message.sort = object.sort ?? 0; + message.version = object.version ?? 0; + message.createUser = object.createUser ?? undefined; + message.createDate = object.createDate ?? undefined; + message.modifyUser = object.modifyUser ?? undefined; + message.modifyDate = object.modifyDate ?? undefined; + return message; + }, +}; + +function createBaseScorecardSectionList(): ScorecardSectionList { + return { items: [] }; +} + +export const ScorecardSectionList = { + encode(message: ScorecardSectionList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.items) { + ScorecardSection.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ScorecardSectionList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseScorecardSectionList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.items.push(ScorecardSection.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ScorecardSectionList { + return { items: Array.isArray(object?.items) ? object.items.map((e: any) => ScorecardSection.fromJSON(e)) : [] }; + }, + + toJSON(message: ScorecardSectionList): unknown { + const obj: any = {}; + if (message.items) { + obj.items = message.items.map((e) => e ? ScorecardSection.toJSON(e) : undefined); + } else { + obj.items = []; + } + return obj; + }, + + create, I>>(base?: I): ScorecardSectionList { + return ScorecardSectionList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ScorecardSectionList { + const message = createBaseScorecardSectionList(); + message.items = object.items?.map((e) => ScorecardSection.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseGetScorecardSectionsInput(): GetScorecardSectionsInput { + return { scorecardGroupId: 0 }; +} + +export const GetScorecardSectionsInput = { + encode(message: GetScorecardSectionsInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.scorecardGroupId !== 0) { + writer.uint32(8).int32(message.scorecardGroupId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetScorecardSectionsInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetScorecardSectionsInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.scorecardGroupId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetScorecardSectionsInput { + return { scorecardGroupId: isSet(object.scorecardGroupId) ? Number(object.scorecardGroupId) : 0 }; + }, + + toJSON(message: GetScorecardSectionsInput): unknown { + const obj: any = {}; + message.scorecardGroupId !== undefined && (obj.scorecardGroupId = Math.round(message.scorecardGroupId)); + return obj; + }, + + create, I>>(base?: I): GetScorecardSectionsInput { + return GetScorecardSectionsInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): GetScorecardSectionsInput { + const message = createBaseGetScorecardSectionsInput(); + message.scorecardGroupId = object.scorecardGroupId ?? 0; + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/services/challenge.ts b/src/models/domain-layer/legacy/services/challenge.ts index 21feaf7..a16d202 100644 --- a/src/models/domain-layer/legacy/services/challenge.ts +++ b/src/models/domain-layer/legacy/services/challenge.ts @@ -1,27 +1,28 @@ /* eslint-disable */ import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; -import { CreateResult, LookupCriteria } from "@topcoder-framework/lib-common"; +import { CheckExistsResult, CreateResult, Empty, LookupCriteria, UpdateResult } from "@topcoder-framework/lib-common"; import { - CheckChallengeExistsResponse, + CloseChallengeInput, CreateChallengeInput, + LegacyChallenge, LegacyChallengeId, LegacyChallengeList, + UpdateChallengeInput, } from "../challenge"; export type LegacyChallengeService = typeof LegacyChallengeService; export const LegacyChallengeService = { - checkChallengeExists: { - path: "/topcoder.domain.legacy_challenge_service.LegacyChallenge/CheckChallengeExists", + checkExists: { + path: "/topcoder.domain.service.legacy_challenge_service.LegacyChallenge/CheckExists", requestStream: false, responseStream: false, requestSerialize: (value: LegacyChallengeId) => Buffer.from(LegacyChallengeId.encode(value).finish()), requestDeserialize: (value: Buffer) => LegacyChallengeId.decode(value), - responseSerialize: (value: CheckChallengeExistsResponse) => - Buffer.from(CheckChallengeExistsResponse.encode(value).finish()), - responseDeserialize: (value: Buffer) => CheckChallengeExistsResponse.decode(value), + responseSerialize: (value: CheckExistsResult) => Buffer.from(CheckExistsResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CheckExistsResult.decode(value), }, lookup: { - path: "/topcoder.domain.legacy_challenge_service.LegacyChallenge/Lookup", + path: "/topcoder.domain.service.legacy_challenge_service.LegacyChallenge/Lookup", requestStream: false, responseStream: false, requestSerialize: (value: LookupCriteria) => Buffer.from(LookupCriteria.encode(value).finish()), @@ -30,7 +31,7 @@ export const LegacyChallengeService = { responseDeserialize: (value: Buffer) => LegacyChallengeList.decode(value), }, create: { - path: "/topcoder.domain.legacy_challenge_service.LegacyChallenge/Create", + path: "/topcoder.domain.service.legacy_challenge_service.LegacyChallenge/Create", requestStream: false, responseStream: false, requestSerialize: (value: CreateChallengeInput) => Buffer.from(CreateChallengeInput.encode(value).finish()), @@ -38,10 +39,50 @@ export const LegacyChallengeService = { responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), responseDeserialize: (value: Buffer) => CreateResult.decode(value), }, + update: { + path: "/topcoder.domain.service.legacy_challenge_service.LegacyChallenge/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateChallengeInput) => Buffer.from(UpdateChallengeInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateChallengeInput.decode(value), + responseSerialize: (value: UpdateResult) => Buffer.from(UpdateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => UpdateResult.decode(value), + }, + get: { + path: "/topcoder.domain.service.legacy_challenge_service.LegacyChallenge/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: LegacyChallengeId) => Buffer.from(LegacyChallengeId.encode(value).finish()), + requestDeserialize: (value: Buffer) => LegacyChallengeId.decode(value), + responseSerialize: (value: LegacyChallenge) => Buffer.from(LegacyChallenge.encode(value).finish()), + responseDeserialize: (value: Buffer) => LegacyChallenge.decode(value), + }, + activate: { + path: "/topcoder.domain.service.legacy_challenge_service.LegacyChallenge/Activate", + requestStream: false, + responseStream: false, + requestSerialize: (value: LegacyChallengeId) => Buffer.from(LegacyChallengeId.encode(value).finish()), + requestDeserialize: (value: Buffer) => LegacyChallengeId.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + closeChallenge: { + path: "/topcoder.domain.service.legacy_challenge_service.LegacyChallenge/CloseChallenge", + requestStream: false, + responseStream: false, + requestSerialize: (value: CloseChallengeInput) => Buffer.from(CloseChallengeInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CloseChallengeInput.decode(value), + responseSerialize: (value: LegacyChallenge) => Buffer.from(LegacyChallenge.encode(value).finish()), + responseDeserialize: (value: Buffer) => LegacyChallenge.decode(value), + }, } as const; export interface LegacyChallengeServer extends UntypedServiceImplementation { - checkChallengeExists: handleUnaryCall; + checkExists: handleUnaryCall; lookup: handleUnaryCall; create: handleUnaryCall; + update: handleUnaryCall; + get: handleUnaryCall; + activate: handleUnaryCall; + closeChallenge: handleUnaryCall; } diff --git a/src/models/domain-layer/legacy/services/challenge_payment.ts b/src/models/domain-layer/legacy/services/challenge_payment.ts new file mode 100644 index 0000000..3dde9b4 --- /dev/null +++ b/src/models/domain-layer/legacy/services/challenge_payment.ts @@ -0,0 +1,62 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CreateResult, Empty, UpdateResult } from "@topcoder-framework/lib-common"; +import { + CreateLegacyChallengePaymentInput, + DeleteLegacyChallengePaymentInput, + GetLegacyChallengePaymentInput, + LegacyChallengePaymentList, + UpdateLegacyChallengePaymentInput, +} from "../challenge_payment"; + +export type LegacyChallengePaymentService = typeof LegacyChallengePaymentService; +export const LegacyChallengePaymentService = { + get: { + path: "/topcoder.domain.service.legacy_challenge_payment.LegacyChallengePayment/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetLegacyChallengePaymentInput) => + Buffer.from(GetLegacyChallengePaymentInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetLegacyChallengePaymentInput.decode(value), + responseSerialize: (value: LegacyChallengePaymentList) => + Buffer.from(LegacyChallengePaymentList.encode(value).finish()), + responseDeserialize: (value: Buffer) => LegacyChallengePaymentList.decode(value), + }, + create: { + path: "/topcoder.domain.service.legacy_challenge_payment.LegacyChallengePayment/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateLegacyChallengePaymentInput) => + Buffer.from(CreateLegacyChallengePaymentInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateLegacyChallengePaymentInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + update: { + path: "/topcoder.domain.service.legacy_challenge_payment.LegacyChallengePayment/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateLegacyChallengePaymentInput) => + Buffer.from(UpdateLegacyChallengePaymentInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateLegacyChallengePaymentInput.decode(value), + responseSerialize: (value: UpdateResult) => Buffer.from(UpdateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => UpdateResult.decode(value), + }, + delete: { + path: "/topcoder.domain.service.legacy_challenge_payment.LegacyChallengePayment/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteLegacyChallengePaymentInput) => + Buffer.from(DeleteLegacyChallengePaymentInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteLegacyChallengePaymentInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, +} as const; + +export interface LegacyChallengePaymentServer extends UntypedServiceImplementation { + get: handleUnaryCall; + create: handleUnaryCall; + update: handleUnaryCall; + delete: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/challenge_phase.ts b/src/models/domain-layer/legacy/services/challenge_phase.ts index d75c8b1..b7c8c0f 100644 --- a/src/models/domain-layer/legacy/services/challenge_phase.ts +++ b/src/models/domain-layer/legacy/services/challenge_phase.ts @@ -6,7 +6,7 @@ import { CreatePhaseInput, PhaseTypeList } from "../challenge_phase"; export type LegacyChallengePhaseService = typeof LegacyChallengePhaseService; export const LegacyChallengePhaseService = { create: { - path: "/topcoder.domain.challenge_phase_service.LegacyChallengePhase/Create", + path: "/topcoder.domain.service.challenge_phase_service.LegacyChallengePhase/Create", requestStream: false, responseStream: false, requestSerialize: (value: CreatePhaseInput) => Buffer.from(CreatePhaseInput.encode(value).finish()), @@ -15,7 +15,7 @@ export const LegacyChallengePhaseService = { responseDeserialize: (value: Buffer) => CreateResult.decode(value), }, getPhaseTypes: { - path: "/topcoder.domain.challenge_phase_service.LegacyChallengePhase/GetPhaseTypes", + path: "/topcoder.domain.service.challenge_phase_service.LegacyChallengePhase/GetPhaseTypes", requestStream: false, responseStream: false, requestSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), diff --git a/src/models/domain-layer/legacy/services/group_contest_eligibility.ts b/src/models/domain-layer/legacy/services/group_contest_eligibility.ts new file mode 100644 index 0000000..32af3bb --- /dev/null +++ b/src/models/domain-layer/legacy/services/group_contest_eligibility.ts @@ -0,0 +1,88 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { Empty } from "@topcoder-framework/lib-common"; +import { + ContestEligibility, + ContestEligibilityList, + DeleteContestEligibilityInput, + DeleteGroupContestEligibilityInput, + GetContestEligibilityInput, + GetGroupContestEligibilityInput, + GroupContestEligibility, + GroupContestEligibilityList, +} from "../group_contest_eligibility"; + +export type LegacyGroupContestEligibilityService = typeof LegacyGroupContestEligibilityService; +export const LegacyGroupContestEligibilityService = { + getContestEligibilities: { + path: "/topcoder.domain.service.group_contest_eligibility.LegacyGroupContestEligibility/GetContestEligibilities", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetContestEligibilityInput) => + Buffer.from(GetContestEligibilityInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetContestEligibilityInput.decode(value), + responseSerialize: (value: ContestEligibilityList) => Buffer.from(ContestEligibilityList.encode(value).finish()), + responseDeserialize: (value: Buffer) => ContestEligibilityList.decode(value), + }, + createContestEligibility: { + path: "/topcoder.domain.service.group_contest_eligibility.LegacyGroupContestEligibility/CreateContestEligibility", + requestStream: false, + responseStream: false, + requestSerialize: (value: ContestEligibility) => Buffer.from(ContestEligibility.encode(value).finish()), + requestDeserialize: (value: Buffer) => ContestEligibility.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + getGroupContestEligibilities: { + path: + "/topcoder.domain.service.group_contest_eligibility.LegacyGroupContestEligibility/GetGroupContestEligibilities", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetGroupContestEligibilityInput) => + Buffer.from(GetGroupContestEligibilityInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetGroupContestEligibilityInput.decode(value), + responseSerialize: (value: GroupContestEligibilityList) => + Buffer.from(GroupContestEligibilityList.encode(value).finish()), + responseDeserialize: (value: Buffer) => GroupContestEligibilityList.decode(value), + }, + createGroupContestEligibility: { + path: + "/topcoder.domain.service.group_contest_eligibility.LegacyGroupContestEligibility/CreateGroupContestEligibility", + requestStream: false, + responseStream: false, + requestSerialize: (value: GroupContestEligibility) => Buffer.from(GroupContestEligibility.encode(value).finish()), + requestDeserialize: (value: Buffer) => GroupContestEligibility.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + deleteContestEligibility: { + path: "/topcoder.domain.service.group_contest_eligibility.LegacyGroupContestEligibility/DeleteContestEligibility", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteContestEligibilityInput) => + Buffer.from(DeleteContestEligibilityInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteContestEligibilityInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + deleteGroupContestEligibility: { + path: + "/topcoder.domain.service.group_contest_eligibility.LegacyGroupContestEligibility/DeleteGroupContestEligibility", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteGroupContestEligibilityInput) => + Buffer.from(DeleteGroupContestEligibilityInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteGroupContestEligibilityInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, +} as const; + +export interface LegacyGroupContestEligibilityServer extends UntypedServiceImplementation { + getContestEligibilities: handleUnaryCall; + createContestEligibility: handleUnaryCall; + getGroupContestEligibilities: handleUnaryCall; + createGroupContestEligibility: handleUnaryCall; + deleteContestEligibility: handleUnaryCall; + deleteGroupContestEligibility: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/notification.ts b/src/models/domain-layer/legacy/services/notification.ts new file mode 100644 index 0000000..cfa2f84 --- /dev/null +++ b/src/models/domain-layer/legacy/services/notification.ts @@ -0,0 +1,31 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { Empty } from "@topcoder-framework/lib-common"; +import { DeleteNotificationsInput, GetNotificationsInput, NotificationList } from "../notification"; + +export type LegacyNotificationService = typeof LegacyNotificationService; +export const LegacyNotificationService = { + getNotifications: { + path: "/topcoder.domain.service.notification.LegacyNotification/GetNotifications", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetNotificationsInput) => Buffer.from(GetNotificationsInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetNotificationsInput.decode(value), + responseSerialize: (value: NotificationList) => Buffer.from(NotificationList.encode(value).finish()), + responseDeserialize: (value: Buffer) => NotificationList.decode(value), + }, + deleteNotifications: { + path: "/topcoder.domain.service.notification.LegacyNotification/DeleteNotifications", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteNotificationsInput) => Buffer.from(DeleteNotificationsInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteNotificationsInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, +} as const; + +export interface LegacyNotificationServer extends UntypedServiceImplementation { + getNotifications: handleUnaryCall; + deleteNotifications: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/payment.ts b/src/models/domain-layer/legacy/services/payment.ts new file mode 100644 index 0000000..1690b7e --- /dev/null +++ b/src/models/domain-layer/legacy/services/payment.ts @@ -0,0 +1,105 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CreateResult, Empty } from "@topcoder-framework/lib-common"; +import { + CreatePrizeInput, + CreateProjectPaymentsInput, + DeletePrizeInput, + DeleteProjectPaymentsInput, + GetPrizesInput, + GetProjectPaymentsInput, + PrizeList, + ProjectPaymentList, + UpdatePrizeInput, + UpdateProjectPaymentsInput, +} from "../payment"; + +export type LegacyPaymentService = typeof LegacyPaymentService; +export const LegacyPaymentService = { + getProjectPayments: { + path: "/topcoder.domain.service.payment.LegacyPayment/GetProjectPayments", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetProjectPaymentsInput) => Buffer.from(GetProjectPaymentsInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetProjectPaymentsInput.decode(value), + responseSerialize: (value: ProjectPaymentList) => Buffer.from(ProjectPaymentList.encode(value).finish()), + responseDeserialize: (value: Buffer) => ProjectPaymentList.decode(value), + }, + createProjectPayment: { + path: "/topcoder.domain.service.payment.LegacyPayment/CreateProjectPayment", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateProjectPaymentsInput) => + Buffer.from(CreateProjectPaymentsInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateProjectPaymentsInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + updateProjectPayment: { + path: "/topcoder.domain.service.payment.LegacyPayment/UpdateProjectPayment", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateProjectPaymentsInput) => + Buffer.from(UpdateProjectPaymentsInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateProjectPaymentsInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + deleteProjectPayment: { + path: "/topcoder.domain.service.payment.LegacyPayment/DeleteProjectPayment", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteProjectPaymentsInput) => + Buffer.from(DeleteProjectPaymentsInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteProjectPaymentsInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + getProjectPrizes: { + path: "/topcoder.domain.service.payment.LegacyPayment/GetProjectPrizes", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetPrizesInput) => Buffer.from(GetPrizesInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetPrizesInput.decode(value), + responseSerialize: (value: PrizeList) => Buffer.from(PrizeList.encode(value).finish()), + responseDeserialize: (value: Buffer) => PrizeList.decode(value), + }, + createProjectPrize: { + path: "/topcoder.domain.service.payment.LegacyPayment/CreateProjectPrize", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreatePrizeInput) => Buffer.from(CreatePrizeInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreatePrizeInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + updateProjectPrize: { + path: "/topcoder.domain.service.payment.LegacyPayment/UpdateProjectPrize", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdatePrizeInput) => Buffer.from(UpdatePrizeInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdatePrizeInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + deleteProjectPrize: { + path: "/topcoder.domain.service.payment.LegacyPayment/DeleteProjectPrize", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeletePrizeInput) => Buffer.from(DeletePrizeInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeletePrizeInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, +} as const; + +export interface LegacyPaymentServer extends UntypedServiceImplementation { + getProjectPayments: handleUnaryCall; + createProjectPayment: handleUnaryCall; + updateProjectPayment: handleUnaryCall; + deleteProjectPayment: handleUnaryCall; + getProjectPrizes: handleUnaryCall; + createProjectPrize: handleUnaryCall; + updateProjectPrize: handleUnaryCall; + deleteProjectPrize: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/phase.ts b/src/models/domain-layer/legacy/services/phase.ts new file mode 100644 index 0000000..b5eb5c2 --- /dev/null +++ b/src/models/domain-layer/legacy/services/phase.ts @@ -0,0 +1,114 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CreateResult, Empty } from "@topcoder-framework/lib-common"; +import { + CreatePhaseCriteriaInput, + CreatePhaseDependencyInput, + CreateProjectPhaseInput, + DeletePhaseCriteriaInput, + DeleteProjectPhasesInput, + GetPhaseCriteriaInput, + GetProjectPhasesInput, + PhaseCriteriaList, + PhaseTypeList, + ProjectPhaseList, + UpdateProjectPhaseInput, +} from "../phase"; + +export type LegacyPhaseService = typeof LegacyPhaseService; +export const LegacyPhaseService = { + getPhaseCriteria: { + path: "/topcoder.domain.service.phase.LegacyPhase/GetPhaseCriteria", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetPhaseCriteriaInput) => Buffer.from(GetPhaseCriteriaInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetPhaseCriteriaInput.decode(value), + responseSerialize: (value: PhaseCriteriaList) => Buffer.from(PhaseCriteriaList.encode(value).finish()), + responseDeserialize: (value: Buffer) => PhaseCriteriaList.decode(value), + }, + createPhaseCriteria: { + path: "/topcoder.domain.service.phase.LegacyPhase/CreatePhaseCriteria", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreatePhaseCriteriaInput) => Buffer.from(CreatePhaseCriteriaInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreatePhaseCriteriaInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + deletePhaseCriteria: { + path: "/topcoder.domain.service.phase.LegacyPhase/DeletePhaseCriteria", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeletePhaseCriteriaInput) => Buffer.from(DeletePhaseCriteriaInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeletePhaseCriteriaInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + getPhaseTypes: { + path: "/topcoder.domain.service.phase.LegacyPhase/GetPhaseTypes", + requestStream: false, + responseStream: false, + requestSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + requestDeserialize: (value: Buffer) => Empty.decode(value), + responseSerialize: (value: PhaseTypeList) => Buffer.from(PhaseTypeList.encode(value).finish()), + responseDeserialize: (value: Buffer) => PhaseTypeList.decode(value), + }, + getProjectPhases: { + path: "/topcoder.domain.service.phase.LegacyPhase/GetProjectPhases", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetProjectPhasesInput) => Buffer.from(GetProjectPhasesInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetProjectPhasesInput.decode(value), + responseSerialize: (value: ProjectPhaseList) => Buffer.from(ProjectPhaseList.encode(value).finish()), + responseDeserialize: (value: Buffer) => ProjectPhaseList.decode(value), + }, + deleteProjectPhases: { + path: "/topcoder.domain.service.phase.LegacyPhase/DeleteProjectPhases", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteProjectPhasesInput) => Buffer.from(DeleteProjectPhasesInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteProjectPhasesInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + createProjectPhase: { + path: "/topcoder.domain.service.phase.LegacyPhase/CreateProjectPhase", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateProjectPhaseInput) => Buffer.from(CreateProjectPhaseInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateProjectPhaseInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + updateProjectPhase: { + path: "/topcoder.domain.service.phase.LegacyPhase/UpdateProjectPhase", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateProjectPhaseInput) => Buffer.from(UpdateProjectPhaseInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateProjectPhaseInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + createPhaseDependency: { + path: "/topcoder.domain.service.phase.LegacyPhase/CreatePhaseDependency", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreatePhaseDependencyInput) => + Buffer.from(CreatePhaseDependencyInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreatePhaseDependencyInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, +} as const; + +export interface LegacyPhaseServer extends UntypedServiceImplementation { + getPhaseCriteria: handleUnaryCall; + createPhaseCriteria: handleUnaryCall; + deletePhaseCriteria: handleUnaryCall; + getPhaseTypes: handleUnaryCall; + getProjectPhases: handleUnaryCall; + deleteProjectPhases: handleUnaryCall; + createProjectPhase: handleUnaryCall; + updateProjectPhase: handleUnaryCall; + createPhaseDependency: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/prize.ts b/src/models/domain-layer/legacy/services/prize.ts index aa9f64a..443901c 100644 --- a/src/models/domain-layer/legacy/services/prize.ts +++ b/src/models/domain-layer/legacy/services/prize.ts @@ -1,12 +1,12 @@ /* eslint-disable */ import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; -import { CreateResult, Empty, ScanCriteria, UpdateResult } from "@topcoder-framework/lib-common"; -import { CreatePrizeInput, PrizeList, PrizeTypeList, UpdatePrizeInput } from "../prize"; +import { CreateResult, Empty, ScanRequest, UpdateResult } from "@topcoder-framework/lib-common"; +import { CreatePrizeInput, DeletePrizeInput, PrizeList, PrizeTypeList, UpdatePrizeInput } from "../prize"; -export type PrizeServiceService = typeof PrizeServiceService; -export const PrizeServiceService = { +export type LegacyPrizeServiceService = typeof LegacyPrizeServiceService; +export const LegacyPrizeServiceService = { create: { - path: "/topcoder.domain.legacy_prize_service.PrizeService/Create", + path: "/topcoder.domain.service.legacy_prize_service.LegacyPrizeService/Create", requestStream: false, responseStream: false, requestSerialize: (value: CreatePrizeInput) => Buffer.from(CreatePrizeInput.encode(value).finish()), @@ -15,16 +15,16 @@ export const PrizeServiceService = { responseDeserialize: (value: Buffer) => CreateResult.decode(value), }, scan: { - path: "/topcoder.domain.legacy_prize_service.PrizeService/Scan", + path: "/topcoder.domain.service.legacy_prize_service.LegacyPrizeService/Scan", requestStream: false, responseStream: false, - requestSerialize: (value: ScanCriteria) => Buffer.from(ScanCriteria.encode(value).finish()), - requestDeserialize: (value: Buffer) => ScanCriteria.decode(value), + requestSerialize: (value: ScanRequest) => Buffer.from(ScanRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ScanRequest.decode(value), responseSerialize: (value: PrizeList) => Buffer.from(PrizeList.encode(value).finish()), responseDeserialize: (value: Buffer) => PrizeList.decode(value), }, update: { - path: "/topcoder.domain.legacy_prize_service.PrizeService/Update", + path: "/topcoder.domain.service.legacy_prize_service.LegacyPrizeService/Update", requestStream: false, responseStream: false, requestSerialize: (value: UpdatePrizeInput) => Buffer.from(UpdatePrizeInput.encode(value).finish()), @@ -33,7 +33,7 @@ export const PrizeServiceService = { responseDeserialize: (value: Buffer) => UpdateResult.decode(value), }, getPrizeTypes: { - path: "/topcoder.domain.legacy_prize_service.PrizeService/GetPrizeTypes", + path: "/topcoder.domain.service.legacy_prize_service.LegacyPrizeService/GetPrizeTypes", requestStream: false, responseStream: false, requestSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), @@ -41,11 +41,21 @@ export const PrizeServiceService = { responseSerialize: (value: PrizeTypeList) => Buffer.from(PrizeTypeList.encode(value).finish()), responseDeserialize: (value: Buffer) => PrizeTypeList.decode(value), }, + delete: { + path: "/topcoder.domain.service.legacy_prize_service.LegacyPrizeService/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeletePrizeInput) => Buffer.from(DeletePrizeInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeletePrizeInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, } as const; -export interface PrizeServiceServer extends UntypedServiceImplementation { +export interface LegacyPrizeServiceServer extends UntypedServiceImplementation { create: handleUnaryCall; - scan: handleUnaryCall; + scan: handleUnaryCall; update: handleUnaryCall; getPrizeTypes: handleUnaryCall; + delete: handleUnaryCall; } diff --git a/src/models/domain-layer/legacy/services/project_info.ts b/src/models/domain-layer/legacy/services/project_info.ts new file mode 100644 index 0000000..d6b516d --- /dev/null +++ b/src/models/domain-layer/legacy/services/project_info.ts @@ -0,0 +1,69 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { Empty, UpdateResult } from "@topcoder-framework/lib-common"; +import { + CreateProjectInfoInput, + DeleteProjectInfoInput, + GetProjectInfoInput, + ProjectInfo, + ProjectInfoList, + ProjectInfoTypeList, + UpdateProjectInfoInput, +} from "../project_info"; + +export type LegacyProjectInfoService = typeof LegacyProjectInfoService; +export const LegacyProjectInfoService = { + create: { + path: "/topcoder.domain.service.project_info.LegacyProjectInfo/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateProjectInfoInput) => Buffer.from(CreateProjectInfoInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateProjectInfoInput.decode(value), + responseSerialize: (value: ProjectInfo) => Buffer.from(ProjectInfo.encode(value).finish()), + responseDeserialize: (value: Buffer) => ProjectInfo.decode(value), + }, + update: { + path: "/topcoder.domain.service.project_info.LegacyProjectInfo/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateProjectInfoInput) => Buffer.from(UpdateProjectInfoInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateProjectInfoInput.decode(value), + responseSerialize: (value: UpdateResult) => Buffer.from(UpdateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => UpdateResult.decode(value), + }, + delete: { + path: "/topcoder.domain.service.project_info.LegacyProjectInfo/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteProjectInfoInput) => Buffer.from(DeleteProjectInfoInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteProjectInfoInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, + getProjectInfo: { + path: "/topcoder.domain.service.project_info.LegacyProjectInfo/GetProjectInfo", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetProjectInfoInput) => Buffer.from(GetProjectInfoInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetProjectInfoInput.decode(value), + responseSerialize: (value: ProjectInfoList) => Buffer.from(ProjectInfoList.encode(value).finish()), + responseDeserialize: (value: Buffer) => ProjectInfoList.decode(value), + }, + getProjectInfoTypes: { + path: "/topcoder.domain.service.project_info.LegacyProjectInfo/GetProjectInfoTypes", + requestStream: false, + responseStream: false, + requestSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + requestDeserialize: (value: Buffer) => Empty.decode(value), + responseSerialize: (value: ProjectInfoTypeList) => Buffer.from(ProjectInfoTypeList.encode(value).finish()), + responseDeserialize: (value: Buffer) => ProjectInfoTypeList.decode(value), + }, +} as const; + +export interface LegacyProjectInfoServer extends UntypedServiceImplementation { + create: handleUnaryCall; + update: handleUnaryCall; + delete: handleUnaryCall; + getProjectInfo: handleUnaryCall; + getProjectInfoTypes: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/resource.ts b/src/models/domain-layer/legacy/services/resource.ts new file mode 100644 index 0000000..4df7d23 --- /dev/null +++ b/src/models/domain-layer/legacy/services/resource.ts @@ -0,0 +1,58 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CreateResult, Empty } from "@topcoder-framework/lib-common"; +import { + CreateResourceInfoInput, + GetResourceInfosInput, + GetResourcesInput, + ResourceInfoList, + ResourceList, + UpdateResourceInfoInput, +} from "../resource"; + +export type LegacyResourceService = typeof LegacyResourceService; +export const LegacyResourceService = { + getResources: { + path: "/topcoder.domain.service.resource.LegacyResource/GetResources", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetResourcesInput) => Buffer.from(GetResourcesInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetResourcesInput.decode(value), + responseSerialize: (value: ResourceList) => Buffer.from(ResourceList.encode(value).finish()), + responseDeserialize: (value: Buffer) => ResourceList.decode(value), + }, + getResourceInfos: { + path: "/topcoder.domain.service.resource.LegacyResource/GetResourceInfos", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetResourceInfosInput) => Buffer.from(GetResourceInfosInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetResourceInfosInput.decode(value), + responseSerialize: (value: ResourceInfoList) => Buffer.from(ResourceInfoList.encode(value).finish()), + responseDeserialize: (value: Buffer) => ResourceInfoList.decode(value), + }, + createResourceInfos: { + path: "/topcoder.domain.service.resource.LegacyResource/CreateResourceInfos", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateResourceInfoInput) => Buffer.from(CreateResourceInfoInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateResourceInfoInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + updateResourceInfos: { + path: "/topcoder.domain.service.resource.LegacyResource/UpdateResourceInfos", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateResourceInfoInput) => Buffer.from(UpdateResourceInfoInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateResourceInfoInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, +} as const; + +export interface LegacyResourceServer extends UntypedServiceImplementation { + getResources: handleUnaryCall; + getResourceInfos: handleUnaryCall; + createResourceInfos: handleUnaryCall; + updateResourceInfos: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/review.ts b/src/models/domain-layer/legacy/services/review.ts new file mode 100644 index 0000000..59367db --- /dev/null +++ b/src/models/domain-layer/legacy/services/review.ts @@ -0,0 +1,41 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CreateResult } from "@topcoder-framework/lib-common"; +import { CreateReviewInput, CreateReviewItemInput, GetSubmissionInput, Submission } from "../review"; + +export type LegacyReviewService = typeof LegacyReviewService; +export const LegacyReviewService = { + createReview: { + path: "/topcoder.domain.service.review.LegacyReview/CreateReview", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateReviewInput) => Buffer.from(CreateReviewInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateReviewInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + createReviewItem: { + path: "/topcoder.domain.service.review.LegacyReview/CreateReviewItem", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateReviewItemInput) => Buffer.from(CreateReviewItemInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateReviewItemInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + getSubmission: { + path: "/topcoder.domain.service.review.LegacyReview/GetSubmission", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetSubmissionInput) => Buffer.from(GetSubmissionInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetSubmissionInput.decode(value), + responseSerialize: (value: Submission) => Buffer.from(Submission.encode(value).finish()), + responseDeserialize: (value: Buffer) => Submission.decode(value), + }, +} as const; + +export interface LegacyReviewServer extends UntypedServiceImplementation { + createReview: handleUnaryCall; + createReviewItem: handleUnaryCall; + getSubmission: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/submission.ts b/src/models/domain-layer/legacy/services/submission.ts new file mode 100644 index 0000000..778a78c --- /dev/null +++ b/src/models/domain-layer/legacy/services/submission.ts @@ -0,0 +1,67 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CheckExistsResult, CreateResult, LookupCriteria, UpdateResult } from "@topcoder-framework/lib-common"; +import { + CreateSubmissionInput, + LegacySubmission, + LegacySubmissionId, + LegacySubmissionList, + UpdateSubmissionInput, +} from "../submission"; + +export type LegacySubmissionService = typeof LegacySubmissionService; +export const LegacySubmissionService = { + checkExists: { + path: "/topcoder.domain.service.legacy_submission_service.LegacySubmission/CheckExists", + requestStream: false, + responseStream: false, + requestSerialize: (value: LegacySubmissionId) => Buffer.from(LegacySubmissionId.encode(value).finish()), + requestDeserialize: (value: Buffer) => LegacySubmissionId.decode(value), + responseSerialize: (value: CheckExistsResult) => Buffer.from(CheckExistsResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CheckExistsResult.decode(value), + }, + lookup: { + path: "/topcoder.domain.service.legacy_submission_service.LegacySubmission/Lookup", + requestStream: false, + responseStream: false, + requestSerialize: (value: LookupCriteria) => Buffer.from(LookupCriteria.encode(value).finish()), + requestDeserialize: (value: Buffer) => LookupCriteria.decode(value), + responseSerialize: (value: LegacySubmissionList) => Buffer.from(LegacySubmissionList.encode(value).finish()), + responseDeserialize: (value: Buffer) => LegacySubmissionList.decode(value), + }, + create: { + path: "/topcoder.domain.service.legacy_submission_service.LegacySubmission/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateSubmissionInput) => Buffer.from(CreateSubmissionInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateSubmissionInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + update: { + path: "/topcoder.domain.service.legacy_submission_service.LegacySubmission/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateSubmissionInput) => Buffer.from(UpdateSubmissionInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateSubmissionInput.decode(value), + responseSerialize: (value: UpdateResult) => Buffer.from(UpdateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => UpdateResult.decode(value), + }, + get: { + path: "/topcoder.domain.service.legacy_submission_service.LegacySubmission/Get", + requestStream: false, + responseStream: false, + requestSerialize: (value: LegacySubmissionId) => Buffer.from(LegacySubmissionId.encode(value).finish()), + requestDeserialize: (value: Buffer) => LegacySubmissionId.decode(value), + responseSerialize: (value: LegacySubmission) => Buffer.from(LegacySubmission.encode(value).finish()), + responseDeserialize: (value: Buffer) => LegacySubmission.decode(value), + }, +} as const; + +export interface LegacySubmissionServer extends UntypedServiceImplementation { + checkExists: handleUnaryCall; + lookup: handleUnaryCall; + create: handleUnaryCall; + update: handleUnaryCall; + get: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/sync.ts b/src/models/domain-layer/legacy/services/sync.ts new file mode 100644 index 0000000..7b7eb95 --- /dev/null +++ b/src/models/domain-layer/legacy/services/sync.ts @@ -0,0 +1,21 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { Empty } from "@topcoder-framework/lib-common"; +import { SyncInput } from "../sync"; + +export type LegacySyncService = typeof LegacySyncService; +export const LegacySyncService = { + syncLegacy: { + path: "/topcoder.domain.service.sync.LegacySync/SyncLegacy", + requestStream: false, + responseStream: false, + requestSerialize: (value: SyncInput) => Buffer.from(SyncInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => SyncInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, +} as const; + +export interface LegacySyncServer extends UntypedServiceImplementation { + syncLegacy: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/term.ts b/src/models/domain-layer/legacy/services/term.ts new file mode 100644 index 0000000..74be816 --- /dev/null +++ b/src/models/domain-layer/legacy/services/term.ts @@ -0,0 +1,50 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CreateResult, Empty } from "@topcoder-framework/lib-common"; +import { + CreateProjectRoleTermsOfUseXrefInput, + DeleteProjectRoleTermsOfUseXrefInput, + GetProjectRoleTermsOfUseXrefInput, + ProjectRoleTermsOfUseXrefList, +} from "../term"; + +export type LegacyTermService = typeof LegacyTermService; +export const LegacyTermService = { + getProjectRoleTermsOfUseXrefs: { + path: "/topcoder.domain.service.term.LegacyTerm/GetProjectRoleTermsOfUseXrefs", + requestStream: false, + responseStream: false, + requestSerialize: (value: GetProjectRoleTermsOfUseXrefInput) => + Buffer.from(GetProjectRoleTermsOfUseXrefInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => GetProjectRoleTermsOfUseXrefInput.decode(value), + responseSerialize: (value: ProjectRoleTermsOfUseXrefList) => + Buffer.from(ProjectRoleTermsOfUseXrefList.encode(value).finish()), + responseDeserialize: (value: Buffer) => ProjectRoleTermsOfUseXrefList.decode(value), + }, + createProjectRoleTermsOfUseXref: { + path: "/topcoder.domain.service.term.LegacyTerm/CreateProjectRoleTermsOfUseXref", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateProjectRoleTermsOfUseXrefInput) => + Buffer.from(CreateProjectRoleTermsOfUseXrefInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateProjectRoleTermsOfUseXrefInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + deleteProjectRoleTermsOfUseXref: { + path: "/topcoder.domain.service.term.LegacyTerm/DeleteProjectRoleTermsOfUseXref", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteProjectRoleTermsOfUseXrefInput) => + Buffer.from(DeleteProjectRoleTermsOfUseXrefInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteProjectRoleTermsOfUseXrefInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, +} as const; + +export interface LegacyTermServer extends UntypedServiceImplementation { + getProjectRoleTermsOfUseXrefs: handleUnaryCall; + createProjectRoleTermsOfUseXref: handleUnaryCall; + deleteProjectRoleTermsOfUseXref: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/submission.ts b/src/models/domain-layer/legacy/submission.ts new file mode 100644 index 0000000..1f69d50 --- /dev/null +++ b/src/models/domain-layer/legacy/submission.ts @@ -0,0 +1,565 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export interface LegacySubmission { + submissionId: number; + submissionStatusId: number; + submissionTypeId: number; + uploadId: number; + createUser: number; + createDate: number; + modifyUser: number; + modifyDate: number; +} + +export interface LegacySubmissionId { + submissionId: number; +} + +export interface LegacySubmissionList { + legacySubmissions: LegacySubmission[]; +} + +export interface CreateSubmissionInput { + submissionStatusId: number; + submissionTypeId: number; + uploadId: number; + createUser: number; + createDate: number; + modifyUser: number; + modifyDate: number; +} + +export interface UpdateSubmissionInput { + submissionId: number; + submissionStatusId: number; + submissionTypeId: number; + uploadId: number; + createUser: number; + createDate: number; + modifyUser: number; + modifyDate: number; +} + +function createBaseLegacySubmission(): LegacySubmission { + return { + submissionId: 0, + submissionStatusId: 0, + submissionTypeId: 0, + uploadId: 0, + createUser: 0, + createDate: 0, + modifyUser: 0, + modifyDate: 0, + }; +} + +export const LegacySubmission = { + encode(message: LegacySubmission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.submissionId !== 0) { + writer.uint32(8).int32(message.submissionId); + } + if (message.submissionStatusId !== 0) { + writer.uint32(16).int32(message.submissionStatusId); + } + if (message.submissionTypeId !== 0) { + writer.uint32(24).int32(message.submissionTypeId); + } + if (message.uploadId !== 0) { + writer.uint32(32).int32(message.uploadId); + } + if (message.createUser !== 0) { + writer.uint32(40).int32(message.createUser); + } + if (message.createDate !== 0) { + writer.uint32(48).int64(message.createDate); + } + if (message.modifyUser !== 0) { + writer.uint32(56).int32(message.modifyUser); + } + if (message.modifyDate !== 0) { + writer.uint32(64).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LegacySubmission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLegacySubmission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submissionId = reader.int32(); + break; + case 2: + message.submissionStatusId = reader.int32(); + break; + case 3: + message.submissionTypeId = reader.int32(); + break; + case 4: + message.uploadId = reader.int32(); + break; + case 5: + message.createUser = reader.int32(); + break; + case 6: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 7: + message.modifyUser = reader.int32(); + break; + case 8: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LegacySubmission { + return { + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, + submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + }; + }, + + toJSON(message: LegacySubmission): unknown { + const obj: any = {}; + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); + message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): LegacySubmission { + return LegacySubmission.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): LegacySubmission { + const message = createBaseLegacySubmission(); + message.submissionId = object.submissionId ?? 0; + message.submissionStatusId = object.submissionStatusId ?? 0; + message.submissionTypeId = object.submissionTypeId ?? 0; + message.uploadId = object.uploadId ?? 0; + message.createUser = object.createUser ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.modifyDate = object.modifyDate ?? 0; + return message; + }, +}; + +function createBaseLegacySubmissionId(): LegacySubmissionId { + return { submissionId: 0 }; +} + +export const LegacySubmissionId = { + encode(message: LegacySubmissionId, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.submissionId !== 0) { + writer.uint32(8).int32(message.submissionId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LegacySubmissionId { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLegacySubmissionId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submissionId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LegacySubmissionId { + return { submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0 }; + }, + + toJSON(message: LegacySubmissionId): unknown { + const obj: any = {}; + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + return obj; + }, + + create, I>>(base?: I): LegacySubmissionId { + return LegacySubmissionId.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): LegacySubmissionId { + const message = createBaseLegacySubmissionId(); + message.submissionId = object.submissionId ?? 0; + return message; + }, +}; + +function createBaseLegacySubmissionList(): LegacySubmissionList { + return { legacySubmissions: [] }; +} + +export const LegacySubmissionList = { + encode(message: LegacySubmissionList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.legacySubmissions) { + LegacySubmission.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LegacySubmissionList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLegacySubmissionList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.legacySubmissions.push(LegacySubmission.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LegacySubmissionList { + return { + legacySubmissions: Array.isArray(object?.legacySubmissions) + ? object.legacySubmissions.map((e: any) => LegacySubmission.fromJSON(e)) + : [], + }; + }, + + toJSON(message: LegacySubmissionList): unknown { + const obj: any = {}; + if (message.legacySubmissions) { + obj.legacySubmissions = message.legacySubmissions.map((e) => e ? LegacySubmission.toJSON(e) : undefined); + } else { + obj.legacySubmissions = []; + } + return obj; + }, + + create, I>>(base?: I): LegacySubmissionList { + return LegacySubmissionList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): LegacySubmissionList { + const message = createBaseLegacySubmissionList(); + message.legacySubmissions = object.legacySubmissions?.map((e) => LegacySubmission.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCreateSubmissionInput(): CreateSubmissionInput { + return { + submissionStatusId: 0, + submissionTypeId: 0, + uploadId: 0, + createUser: 0, + createDate: 0, + modifyUser: 0, + modifyDate: 0, + }; +} + +export const CreateSubmissionInput = { + encode(message: CreateSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.submissionStatusId !== 0) { + writer.uint32(8).int32(message.submissionStatusId); + } + if (message.submissionTypeId !== 0) { + writer.uint32(16).int32(message.submissionTypeId); + } + if (message.uploadId !== 0) { + writer.uint32(24).int32(message.uploadId); + } + if (message.createUser !== 0) { + writer.uint32(32).int32(message.createUser); + } + if (message.createDate !== 0) { + writer.uint32(40).int64(message.createDate); + } + if (message.modifyUser !== 0) { + writer.uint32(48).int32(message.modifyUser); + } + if (message.modifyDate !== 0) { + writer.uint32(56).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateSubmissionInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateSubmissionInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submissionStatusId = reader.int32(); + break; + case 2: + message.submissionTypeId = reader.int32(); + break; + case 3: + message.uploadId = reader.int32(); + break; + case 4: + message.createUser = reader.int32(); + break; + case 5: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 6: + message.modifyUser = reader.int32(); + break; + case 7: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateSubmissionInput { + return { + submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, + submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + }; + }, + + toJSON(message: CreateSubmissionInput): unknown { + const obj: any = {}; + message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); + message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): CreateSubmissionInput { + return CreateSubmissionInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateSubmissionInput { + const message = createBaseCreateSubmissionInput(); + message.submissionStatusId = object.submissionStatusId ?? 0; + message.submissionTypeId = object.submissionTypeId ?? 0; + message.uploadId = object.uploadId ?? 0; + message.createUser = object.createUser ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.modifyDate = object.modifyDate ?? 0; + return message; + }, +}; + +function createBaseUpdateSubmissionInput(): UpdateSubmissionInput { + return { + submissionId: 0, + submissionStatusId: 0, + submissionTypeId: 0, + uploadId: 0, + createUser: 0, + createDate: 0, + modifyUser: 0, + modifyDate: 0, + }; +} + +export const UpdateSubmissionInput = { + encode(message: UpdateSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.submissionId !== 0) { + writer.uint32(8).int32(message.submissionId); + } + if (message.submissionStatusId !== 0) { + writer.uint32(16).int32(message.submissionStatusId); + } + if (message.submissionTypeId !== 0) { + writer.uint32(24).int32(message.submissionTypeId); + } + if (message.uploadId !== 0) { + writer.uint32(32).int32(message.uploadId); + } + if (message.createUser !== 0) { + writer.uint32(40).int32(message.createUser); + } + if (message.createDate !== 0) { + writer.uint32(48).int64(message.createDate); + } + if (message.modifyUser !== 0) { + writer.uint32(56).int32(message.modifyUser); + } + if (message.modifyDate !== 0) { + writer.uint32(64).int64(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSubmissionInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateSubmissionInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submissionId = reader.int32(); + break; + case 2: + message.submissionStatusId = reader.int32(); + break; + case 3: + message.submissionTypeId = reader.int32(); + break; + case 4: + message.uploadId = reader.int32(); + break; + case 5: + message.createUser = reader.int32(); + break; + case 6: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 7: + message.modifyUser = reader.int32(); + break; + case 8: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateSubmissionInput { + return { + submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, + submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + }; + }, + + toJSON(message: UpdateSubmissionInput): unknown { + const obj: any = {}; + message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); + message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): UpdateSubmissionInput { + return UpdateSubmissionInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UpdateSubmissionInput { + const message = createBaseUpdateSubmissionInput(); + message.submissionId = object.submissionId ?? 0; + message.submissionStatusId = object.submissionStatusId ?? 0; + message.submissionTypeId = object.submissionTypeId ?? 0; + message.uploadId = object.uploadId ?? 0; + message.createUser = object.createUser ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.modifyDate = object.modifyDate ?? 0; + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/sync.ts b/src/models/domain-layer/legacy/sync.ts new file mode 100644 index 0000000..2cf6de9 --- /dev/null +++ b/src/models/domain-layer/legacy/sync.ts @@ -0,0 +1,172 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export interface SyncInput { + projectId: number; + updatedTables: Table[]; +} + +export interface Table { + table: string; + primaryKey: string; + value: string[]; +} + +function createBaseSyncInput(): SyncInput { + return { projectId: 0, updatedTables: [] }; +} + +export const SyncInput = { + encode(message: SyncInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + for (const v of message.updatedTables) { + Table.encode(v!, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SyncInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSyncInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.updatedTables.push(Table.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SyncInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + updatedTables: Array.isArray(object?.updatedTables) + ? object.updatedTables.map((e: any) => Table.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SyncInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + if (message.updatedTables) { + obj.updatedTables = message.updatedTables.map((e) => e ? Table.toJSON(e) : undefined); + } else { + obj.updatedTables = []; + } + return obj; + }, + + create, I>>(base?: I): SyncInput { + return SyncInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): SyncInput { + const message = createBaseSyncInput(); + message.projectId = object.projectId ?? 0; + message.updatedTables = object.updatedTables?.map((e) => Table.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseTable(): Table { + return { table: "", primaryKey: "", value: [] }; +} + +export const Table = { + encode(message: Table, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.table !== "") { + writer.uint32(10).string(message.table); + } + if (message.primaryKey !== "") { + writer.uint32(18).string(message.primaryKey); + } + for (const v of message.value) { + writer.uint32(26).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Table { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseTable(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.table = reader.string(); + break; + case 2: + message.primaryKey = reader.string(); + break; + case 3: + message.value.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Table { + return { + table: isSet(object.table) ? String(object.table) : "", + primaryKey: isSet(object.primaryKey) ? String(object.primaryKey) : "", + value: Array.isArray(object?.value) ? object.value.map((e: any) => String(e)) : [], + }; + }, + + toJSON(message: Table): unknown { + const obj: any = {}; + message.table !== undefined && (obj.table = message.table); + message.primaryKey !== undefined && (obj.primaryKey = message.primaryKey); + if (message.value) { + obj.value = message.value.map((e) => e); + } else { + obj.value = []; + } + return obj; + }, + + create, I>>(base?: I): Table { + return Table.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Table { + const message = createBaseTable(); + message.table = object.table ?? ""; + message.primaryKey = object.primaryKey ?? ""; + message.value = object.value?.map((e) => e) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/term.ts b/src/models/domain-layer/legacy/term.ts new file mode 100644 index 0000000..bde4bf1 --- /dev/null +++ b/src/models/domain-layer/legacy/term.ts @@ -0,0 +1,471 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export interface ProjectRoleTermsOfUseXref { + projectId: number; + resourceRoleId: number; + termsOfUseId: number; + createDate: number; + modifyDate: number; + sortOrder: number; + groupInd: number; +} + +export interface GetProjectRoleTermsOfUseXrefInput { + projectId: number; +} + +export interface ProjectRoleTermsOfUseXrefList { + terms: ProjectRoleTermsOfUseXref[]; +} + +export interface CreateProjectRoleTermsOfUseXrefInput { + projectId: number; + resourceRoleId: number; + termsOfUseId: number; + sortOrder?: number | undefined; + groupInd?: number | undefined; +} + +export interface DeleteProjectRoleTermsOfUseXrefInput { + projectId: number; + resourceRoleId: number; + termsOfUseId: number; +} + +function createBaseProjectRoleTermsOfUseXref(): ProjectRoleTermsOfUseXref { + return { projectId: 0, resourceRoleId: 0, termsOfUseId: 0, createDate: 0, modifyDate: 0, sortOrder: 0, groupInd: 0 }; +} + +export const ProjectRoleTermsOfUseXref = { + encode(message: ProjectRoleTermsOfUseXref, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.resourceRoleId !== 0) { + writer.uint32(16).int32(message.resourceRoleId); + } + if (message.termsOfUseId !== 0) { + writer.uint32(24).int32(message.termsOfUseId); + } + if (message.createDate !== 0) { + writer.uint32(32).int64(message.createDate); + } + if (message.modifyDate !== 0) { + writer.uint32(40).int64(message.modifyDate); + } + if (message.sortOrder !== 0) { + writer.uint32(48).int32(message.sortOrder); + } + if (message.groupInd !== 0) { + writer.uint32(56).int32(message.groupInd); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProjectRoleTermsOfUseXref { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProjectRoleTermsOfUseXref(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.resourceRoleId = reader.int32(); + break; + case 3: + message.termsOfUseId = reader.int32(); + break; + case 4: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 5: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + case 6: + message.sortOrder = reader.int32(); + break; + case 7: + message.groupInd = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProjectRoleTermsOfUseXref { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + resourceRoleId: isSet(object.resourceRoleId) ? Number(object.resourceRoleId) : 0, + termsOfUseId: isSet(object.termsOfUseId) ? Number(object.termsOfUseId) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + sortOrder: isSet(object.sortOrder) ? Number(object.sortOrder) : 0, + groupInd: isSet(object.groupInd) ? Number(object.groupInd) : 0, + }; + }, + + toJSON(message: ProjectRoleTermsOfUseXref): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.resourceRoleId !== undefined && (obj.resourceRoleId = Math.round(message.resourceRoleId)); + message.termsOfUseId !== undefined && (obj.termsOfUseId = Math.round(message.termsOfUseId)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + message.sortOrder !== undefined && (obj.sortOrder = Math.round(message.sortOrder)); + message.groupInd !== undefined && (obj.groupInd = Math.round(message.groupInd)); + return obj; + }, + + create, I>>(base?: I): ProjectRoleTermsOfUseXref { + return ProjectRoleTermsOfUseXref.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): ProjectRoleTermsOfUseXref { + const message = createBaseProjectRoleTermsOfUseXref(); + message.projectId = object.projectId ?? 0; + message.resourceRoleId = object.resourceRoleId ?? 0; + message.termsOfUseId = object.termsOfUseId ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyDate = object.modifyDate ?? 0; + message.sortOrder = object.sortOrder ?? 0; + message.groupInd = object.groupInd ?? 0; + return message; + }, +}; + +function createBaseGetProjectRoleTermsOfUseXrefInput(): GetProjectRoleTermsOfUseXrefInput { + return { projectId: 0 }; +} + +export const GetProjectRoleTermsOfUseXrefInput = { + encode(message: GetProjectRoleTermsOfUseXrefInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetProjectRoleTermsOfUseXrefInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetProjectRoleTermsOfUseXrefInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetProjectRoleTermsOfUseXrefInput { + return { projectId: isSet(object.projectId) ? Number(object.projectId) : 0 }; + }, + + toJSON(message: GetProjectRoleTermsOfUseXrefInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + return obj; + }, + + create, I>>( + base?: I, + ): GetProjectRoleTermsOfUseXrefInput { + return GetProjectRoleTermsOfUseXrefInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): GetProjectRoleTermsOfUseXrefInput { + const message = createBaseGetProjectRoleTermsOfUseXrefInput(); + message.projectId = object.projectId ?? 0; + return message; + }, +}; + +function createBaseProjectRoleTermsOfUseXrefList(): ProjectRoleTermsOfUseXrefList { + return { terms: [] }; +} + +export const ProjectRoleTermsOfUseXrefList = { + encode(message: ProjectRoleTermsOfUseXrefList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.terms) { + ProjectRoleTermsOfUseXref.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ProjectRoleTermsOfUseXrefList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseProjectRoleTermsOfUseXrefList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.terms.push(ProjectRoleTermsOfUseXref.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ProjectRoleTermsOfUseXrefList { + return { + terms: Array.isArray(object?.terms) ? object.terms.map((e: any) => ProjectRoleTermsOfUseXref.fromJSON(e)) : [], + }; + }, + + toJSON(message: ProjectRoleTermsOfUseXrefList): unknown { + const obj: any = {}; + if (message.terms) { + obj.terms = message.terms.map((e) => e ? ProjectRoleTermsOfUseXref.toJSON(e) : undefined); + } else { + obj.terms = []; + } + return obj; + }, + + create, I>>(base?: I): ProjectRoleTermsOfUseXrefList { + return ProjectRoleTermsOfUseXrefList.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): ProjectRoleTermsOfUseXrefList { + const message = createBaseProjectRoleTermsOfUseXrefList(); + message.terms = object.terms?.map((e) => ProjectRoleTermsOfUseXref.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCreateProjectRoleTermsOfUseXrefInput(): CreateProjectRoleTermsOfUseXrefInput { + return { projectId: 0, resourceRoleId: 0, termsOfUseId: 0, sortOrder: undefined, groupInd: undefined }; +} + +export const CreateProjectRoleTermsOfUseXrefInput = { + encode(message: CreateProjectRoleTermsOfUseXrefInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.resourceRoleId !== 0) { + writer.uint32(16).int32(message.resourceRoleId); + } + if (message.termsOfUseId !== 0) { + writer.uint32(24).int32(message.termsOfUseId); + } + if (message.sortOrder !== undefined) { + writer.uint32(32).int32(message.sortOrder); + } + if (message.groupInd !== undefined) { + writer.uint32(40).int32(message.groupInd); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateProjectRoleTermsOfUseXrefInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateProjectRoleTermsOfUseXrefInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.resourceRoleId = reader.int32(); + break; + case 3: + message.termsOfUseId = reader.int32(); + break; + case 4: + message.sortOrder = reader.int32(); + break; + case 5: + message.groupInd = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateProjectRoleTermsOfUseXrefInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + resourceRoleId: isSet(object.resourceRoleId) ? Number(object.resourceRoleId) : 0, + termsOfUseId: isSet(object.termsOfUseId) ? Number(object.termsOfUseId) : 0, + sortOrder: isSet(object.sortOrder) ? Number(object.sortOrder) : undefined, + groupInd: isSet(object.groupInd) ? Number(object.groupInd) : undefined, + }; + }, + + toJSON(message: CreateProjectRoleTermsOfUseXrefInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.resourceRoleId !== undefined && (obj.resourceRoleId = Math.round(message.resourceRoleId)); + message.termsOfUseId !== undefined && (obj.termsOfUseId = Math.round(message.termsOfUseId)); + message.sortOrder !== undefined && (obj.sortOrder = Math.round(message.sortOrder)); + message.groupInd !== undefined && (obj.groupInd = Math.round(message.groupInd)); + return obj; + }, + + create, I>>( + base?: I, + ): CreateProjectRoleTermsOfUseXrefInput { + return CreateProjectRoleTermsOfUseXrefInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): CreateProjectRoleTermsOfUseXrefInput { + const message = createBaseCreateProjectRoleTermsOfUseXrefInput(); + message.projectId = object.projectId ?? 0; + message.resourceRoleId = object.resourceRoleId ?? 0; + message.termsOfUseId = object.termsOfUseId ?? 0; + message.sortOrder = object.sortOrder ?? undefined; + message.groupInd = object.groupInd ?? undefined; + return message; + }, +}; + +function createBaseDeleteProjectRoleTermsOfUseXrefInput(): DeleteProjectRoleTermsOfUseXrefInput { + return { projectId: 0, resourceRoleId: 0, termsOfUseId: 0 }; +} + +export const DeleteProjectRoleTermsOfUseXrefInput = { + encode(message: DeleteProjectRoleTermsOfUseXrefInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.resourceRoleId !== 0) { + writer.uint32(16).int32(message.resourceRoleId); + } + if (message.termsOfUseId !== 0) { + writer.uint32(24).int32(message.termsOfUseId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteProjectRoleTermsOfUseXrefInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteProjectRoleTermsOfUseXrefInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.resourceRoleId = reader.int32(); + break; + case 3: + message.termsOfUseId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteProjectRoleTermsOfUseXrefInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + resourceRoleId: isSet(object.resourceRoleId) ? Number(object.resourceRoleId) : 0, + termsOfUseId: isSet(object.termsOfUseId) ? Number(object.termsOfUseId) : 0, + }; + }, + + toJSON(message: DeleteProjectRoleTermsOfUseXrefInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.resourceRoleId !== undefined && (obj.resourceRoleId = Math.round(message.resourceRoleId)); + message.termsOfUseId !== undefined && (obj.termsOfUseId = Math.round(message.termsOfUseId)); + return obj; + }, + + create, I>>( + base?: I, + ): DeleteProjectRoleTermsOfUseXrefInput { + return DeleteProjectRoleTermsOfUseXrefInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): DeleteProjectRoleTermsOfUseXrefInput { + const message = createBaseDeleteProjectRoleTermsOfUseXrefInput(); + message.projectId = object.projectId ?? 0; + message.resourceRoleId = object.resourceRoleId ?? 0; + message.termsOfUseId = object.termsOfUseId ?? 0; + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/user.ts b/src/models/domain-layer/legacy/user.ts new file mode 100644 index 0000000..6382d6b --- /dev/null +++ b/src/models/domain-layer/legacy/user.ts @@ -0,0 +1,186 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export interface User { + userId: number; + firstName: string; + lastName: string; + createDate: number; + modifyDate: number; + handle: string; + status: string; + handleLower: string; +} + +function createBaseUser(): User { + return { + userId: 0, + firstName: "", + lastName: "", + createDate: 0, + modifyDate: 0, + handle: "", + status: "", + handleLower: "", + }; +} + +export const User = { + encode(message: User, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.userId !== 0) { + writer.uint32(8).int64(message.userId); + } + if (message.firstName !== "") { + writer.uint32(18).string(message.firstName); + } + if (message.lastName !== "") { + writer.uint32(26).string(message.lastName); + } + if (message.createDate !== 0) { + writer.uint32(32).int64(message.createDate); + } + if (message.modifyDate !== 0) { + writer.uint32(40).int64(message.modifyDate); + } + if (message.handle !== "") { + writer.uint32(50).string(message.handle); + } + if (message.status !== "") { + writer.uint32(66).string(message.status); + } + if (message.handleLower !== "") { + writer.uint32(90).string(message.handleLower); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): User { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUser(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.userId = longToNumber(reader.int64() as Long); + break; + case 2: + message.firstName = reader.string(); + break; + case 3: + message.lastName = reader.string(); + break; + case 4: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 5: + message.modifyDate = longToNumber(reader.int64() as Long); + break; + case 6: + message.handle = reader.string(); + break; + case 8: + message.status = reader.string(); + break; + case 11: + message.handleLower = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): User { + return { + userId: isSet(object.userId) ? Number(object.userId) : 0, + firstName: isSet(object.firstName) ? String(object.firstName) : "", + lastName: isSet(object.lastName) ? String(object.lastName) : "", + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + handle: isSet(object.handle) ? String(object.handle) : "", + status: isSet(object.status) ? String(object.status) : "", + handleLower: isSet(object.handleLower) ? String(object.handleLower) : "", + }; + }, + + toJSON(message: User): unknown { + const obj: any = {}; + message.userId !== undefined && (obj.userId = Math.round(message.userId)); + message.firstName !== undefined && (obj.firstName = message.firstName); + message.lastName !== undefined && (obj.lastName = message.lastName); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + message.handle !== undefined && (obj.handle = message.handle); + message.status !== undefined && (obj.status = message.status); + message.handleLower !== undefined && (obj.handleLower = message.handleLower); + return obj; + }, + + create, I>>(base?: I): User { + return User.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): User { + const message = createBaseUser(); + message.userId = object.userId ?? 0; + message.firstName = object.firstName ?? ""; + message.lastName = object.lastName ?? ""; + message.createDate = object.createDate ?? 0; + message.modifyDate = object.modifyDate ?? 0; + message.handle = object.handle ?? ""; + message.status = object.status ?? ""; + message.handleLower = object.handleLower ?? ""; + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/server.ts b/src/server.ts index 648f1a2..6831366 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,33 +1,32 @@ import "source-map-support/register"; -import * as dotenv from "dotenv"; -dotenv.config(); import * as path from "path"; import { Server, ServerCredentials } from "@grpc/grpc-js"; import { addReflection } from "grpc-server-reflection"; import { LegacyChallengeServer, LegacyChallengeService } from "./service/LegacyChallenge"; - +import { LegacySubmissionServer, LegacySubmissionService } from "./service/LegacySubmission"; import { LegacyChallengePhaseService, LegacyChallengePhaseServer, } from "./service/LegacyChallengePhase"; +import { GRPC_SERVER_HOST, GRPC_SERVER_PORT, ENV } from './config' import { PrizeServiceService, PrizeServer } from "./service/Prize"; -const { GRPC_SERVER_HOST = "", GRPC_SERVER_PORT = 9091 } = process.env; const server = new Server({ "grpc.max_send_message_length": -1, "grpc.max_receive_message_length": -1, }); -if (process.env.ENV === "local") { +if (ENV === "local") { addReflection(server, path.join(__dirname, "../reflections/reflection.bin")); } server.addService(LegacyChallengeService, new LegacyChallengeServer()); +server.addService(LegacySubmissionService, new LegacySubmissionServer()); server.addService(LegacyChallengePhaseService, new LegacyChallengePhaseServer()); server.addService(PrizeServiceService, new PrizeServer()); diff --git a/src/service/LegacyChallenge.ts b/src/service/LegacyChallenge.ts index 5ce39ef..872fe65 100644 --- a/src/service/LegacyChallenge.ts +++ b/src/service/LegacyChallenge.ts @@ -38,7 +38,7 @@ class LegacyChallengeServerImpl implements LegacyChallengeServer { lookup: handleUnaryCall = ( call: ServerUnaryCall, callback: sendUnaryData - ) => {}; + ) => { }; } export { LegacyChallengeServerImpl as LegacyChallengeServer, LegacyChallengeService }; diff --git a/src/service/LegacySubmission.ts b/src/service/LegacySubmission.ts new file mode 100644 index 0000000..3fc545b --- /dev/null +++ b/src/service/LegacySubmission.ts @@ -0,0 +1,48 @@ +import { handleUnaryCall, sendUnaryData, ServerUnaryCall, UntypedHandleCall } from "@grpc/grpc-js"; +import { + CreateResult, LookupCriteria, + CheckExistsResult, UpdateResult +} from "@topcoder-framework/lib-common"; +import LegacySubmissionDomain from '../domain/LegacySubmission' + +import { LegacySubmissionService, LegacySubmissionServer } from '../models/domain-layer/legacy/services/submission'; +import { + CreateSubmissionInput, LegacySubmissionId, + LegacySubmissionList, UpdateSubmissionInput, + LegacySubmission +} from "../models/domain-layer/legacy/submission"; + +class LegacySubmissionServerImpl implements LegacySubmissionServer { + create: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { + LegacySubmissionDomain.createLegacySubmission(call.request) + .then((response) => callback(null, response)) //TODO: Fix this response type + .catch((err) => callback(err, null)); + }; + + [name: string]: UntypedHandleCall; + checkExists: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { }; + + + lookup: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { }; + + get: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { }; + + update: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { }; +} + +export { LegacySubmissionServerImpl as LegacySubmissionServer, LegacySubmissionService }; \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index fe6ecbb..1536b59 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4,23 +4,23 @@ "@cspotcode/source-map-support@^0.8.0": version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" + resolved "http://localhost:4873/@cspotcode%2fsource-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== dependencies: "@jridgewell/trace-mapping" "0.3.9" "@grpc/grpc-js@^1.7.1", "@grpc/grpc-js@^1.8.0": - version "1.8.8" - resolved "https://registry.yarnpkg.com/@grpc/grpc-js/-/grpc-js-1.8.8.tgz#a7c6765d0302f47ba67c0ce3cb79718d6b028248" - integrity sha512-4gfDqMLXTrorvYTKA1jL22zLvVwiHJ73t6Re1OHwdCFRjdGTDOVtSJuaWhtHaivyeDGg0LeCkmU77MTKoV3wPA== + version "1.8.11" + resolved "http://localhost:4873/@grpc%2fgrpc-js/-/grpc-js-1.8.11.tgz#f113f7bc197e8d6f3d3f0c6b02925c7a5da1aec4" + integrity sha512-f/xC+6Z2QKsRJ+VSSFlt4hA5KSRm+PKvMWV8kMPkMgGlFidR6PeIkXrOasIY2roe+WROM6GFQLlgDKfeEZo2YQ== dependencies: "@grpc/proto-loader" "^0.7.0" "@types/node" ">=12.12.47" "@grpc/proto-loader@^0.7.0": - version "0.7.4" - resolved "https://registry.yarnpkg.com/@grpc/proto-loader/-/proto-loader-0.7.4.tgz#4946a84fbf47c3ddd4e6a97acb79d69a9f47ebf2" - integrity sha512-MnWjkGwqQ3W8fx94/c1CwqLsNmHHv2t0CFn+9++6+cDphC1lolpg9M2OU0iebIjK//pBNX9e94ho+gjx6vz39w== + version "0.7.5" + resolved "http://localhost:4873/@grpc%2fproto-loader/-/proto-loader-0.7.5.tgz#ee9e7488fa585dc6b0f7fe88cd39723a3e64c906" + integrity sha512-mfcTuMbFowq1wh/Rn5KQl6qb95M21Prej3bewD9dUQMurYGVckGO/Pbe2Ocwto6sD05b/mxZLspvqwx60xO2Rg== dependencies: "@types/long" "^4.0.1" lodash.camelcase "^4.3.0" @@ -30,17 +30,17 @@ "@jridgewell/resolve-uri@^3.0.3": version "3.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + resolved "http://localhost:4873/@jridgewell%2fresolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.14" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + resolved "http://localhost:4873/@jridgewell%2fsourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== "@jridgewell/trace-mapping@0.3.9": version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" + resolved "http://localhost:4873/@jridgewell%2ftrace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== dependencies: "@jridgewell/resolve-uri" "^3.0.3" @@ -48,27 +48,27 @@ "@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + resolved "http://localhost:4873/@protobufjs%2faspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== "@protobufjs/base64@^1.1.2": version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + resolved "http://localhost:4873/@protobufjs%2fbase64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== "@protobufjs/codegen@^2.0.4": version "2.0.4" - resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + resolved "http://localhost:4873/@protobufjs%2fcodegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== "@protobufjs/eventemitter@^1.1.0": version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + resolved "http://localhost:4873/@protobufjs%2feventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== "@protobufjs/fetch@^1.1.0": version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + resolved "http://localhost:4873/@protobufjs%2ffetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== dependencies: "@protobufjs/aspromise" "^1.1.1" @@ -76,135 +76,134 @@ "@protobufjs/float@^1.0.2": version "1.0.2" - resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + resolved "http://localhost:4873/@protobufjs%2ffloat/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== "@protobufjs/inquire@^1.1.0": version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + resolved "http://localhost:4873/@protobufjs%2finquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== "@protobufjs/path@^1.1.2": version "1.1.2" - resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + resolved "http://localhost:4873/@protobufjs%2fpath/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== "@protobufjs/pool@^1.1.0": version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + resolved "http://localhost:4873/@protobufjs%2fpool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== "@protobufjs/utf8@^1.1.0": version "1.1.0" - resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + resolved "http://localhost:4873/@protobufjs%2futf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== -"@topcoder-framework/client-relational@^0.4.22-ci.0", "@topcoder-framework/client-relational@^0.4.24-ci.0": - version "0.4.24-ci.0" - resolved "http://localhost:4873/@topcoder-framework%2fclient-relational/-/client-relational-0.4.24-ci.0.tgz#ada970a70f7c9c34371752523ce20cbf734a40a7" - integrity sha512-cnyzp4414BQuFml//y2A9Vgo0ULMSFEEnKjrq8kdpitvncVIenkowai6Geic37tOvnwZG3xxBNtmiHpDw3u/4A== +"@topcoder-framework/client-relational@^0.5.1-ci.0": + version "0.5.1-ci.0" + resolved "http://localhost:4873/@topcoder-framework%2fclient-relational/-/client-relational-0.5.1-ci.0.tgz#d89d639139bbb9e338811c15f93b536566e3d243" + integrity sha512-9vkNoYwssv91IZ5lS6Y7IRE6qqtdCLQbbYpQNnFuvhPpmrFcbeGeZ3Nl/KOV6ocRtBcxWvpTLO8VYojYIdkEYA== dependencies: "@grpc/grpc-js" "^1.8.0" - "@topcoder-framework/lib-common" "0.4.23-ci.0" - topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.10" + "@topcoder-framework/lib-common" "0.5.1-ci.0" + topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.18" tslib "^2.4.1" -"@topcoder-framework/lib-common@0.4.23-ci.0", "@topcoder-framework/lib-common@^0.4.24-ci.0": - version "0.4.24-ci.0" - resolved "http://localhost:4873/@topcoder-framework%2flib-common/-/lib-common-0.4.24-ci.0.tgz#3f32ce108fa799bb5522200f21c4173e1328f816" - integrity sha512-h3TrHGUIewfd/psX7yvoT/eUrh+E3KDpTCWEyVrmb3YD8CcvqFzeks2ryTZ1JADJHJoREQUFRNuW5odApQbJIg== +"@topcoder-framework/lib-common@0.5.1-ci.0", "@topcoder-framework/lib-common@^0.5.1-ci.0": + version "0.5.1-ci.0" + resolved "http://localhost:4873/@topcoder-framework%2flib-common/-/lib-common-0.5.1-ci.0.tgz#1a29e542a9cde7935b776500f25651d1cbdbccc1" + integrity sha512-hFTrNPYsy517cCj7LeSvZUCi0ABMvs4B7RFG79O36lJq+tPsD41PTm60ylDdHjeWxPBaSPRIqZAwW0e5szPy8Q== dependencies: "@grpc/grpc-js" "^1.8.0" - "@topcoder-framework/client-relational" "^0.4.22-ci.0" rimraf "^3.0.2" - topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.10" + topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.18" tslib "^2.4.1" "@tsconfig/node10@^1.0.7": version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" + resolved "http://localhost:4873/@tsconfig%2fnode10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" integrity sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA== "@tsconfig/node12@^1.0.7": version "1.0.11" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" + resolved "http://localhost:4873/@tsconfig%2fnode12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d" integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag== "@tsconfig/node14@^1.0.0": version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" + resolved "http://localhost:4873/@tsconfig%2fnode14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1" integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow== "@tsconfig/node16@^1.0.2": version "1.0.3" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" + resolved "http://localhost:4873/@tsconfig%2fnode16/-/node16-1.0.3.tgz#472eaab5f15c1ffdd7f8628bd4c4f753995ec79e" integrity sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ== "@types/lodash@^4.14.186": version "4.14.191" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.191.tgz#09511e7f7cba275acd8b419ddac8da9a6a79e2fa" + resolved "http://localhost:4873/@types%2flodash/-/lodash-4.14.191.tgz#09511e7f7cba275acd8b419ddac8da9a6a79e2fa" integrity sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ== "@types/long@^4.0.1": version "4.0.2" - resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" + resolved "http://localhost:4873/@types%2flong/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== "@types/node@18.11.18": version "18.11.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" + resolved "http://localhost:4873/@types%2fnode/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== "@types/node@>=12.12.47", "@types/node@>=13.7.0": - version "18.13.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.13.0.tgz#0400d1e6ce87e9d3032c19eb6c58205b0d3f7850" - integrity sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg== + version "18.14.1" + resolved "http://localhost:4873/@types%2fnode/-/node-18.14.1.tgz#90dad8476f1e42797c49d6f8b69aaf9f876fc69f" + integrity sha512-QH+37Qds3E0eDlReeboBxfHbX9omAcBCXEzswCu6jySP642jiM3cYSIkU/REqwhCUqXdonHFuBfJDiAJxMNhaQ== "@types/object-hash@^1.3.0": version "1.3.4" - resolved "https://registry.yarnpkg.com/@types/object-hash/-/object-hash-1.3.4.tgz#079ba142be65833293673254831b5e3e847fe58b" + resolved "http://localhost:4873/@types%2fobject-hash/-/object-hash-1.3.4.tgz#079ba142be65833293673254831b5e3e847fe58b" integrity sha512-xFdpkAkikBgqBdG9vIlsqffDV8GpvnPEzs0IUtr1v3BEB97ijsFQ4RXVbUZwjFThhB4MDSTUfvmxUD5PGx0wXA== "@types/strip-bom@^3.0.0": version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/strip-bom/-/strip-bom-3.0.0.tgz#14a8ec3956c2e81edb7520790aecf21c290aebd2" + resolved "http://localhost:4873/@types%2fstrip-bom/-/strip-bom-3.0.0.tgz#14a8ec3956c2e81edb7520790aecf21c290aebd2" integrity sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ== "@types/strip-json-comments@0.0.30": version "0.0.30" - resolved "https://registry.yarnpkg.com/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1" + resolved "http://localhost:4873/@types%2fstrip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1" integrity sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ== "@types/uuid@8.3.4": version "8.3.4" - resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" + resolved "http://localhost:4873/@types%2fuuid/-/uuid-8.3.4.tgz#bd86a43617df0594787d38b735f55c805becf1bc" integrity sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw== acorn-walk@^8.1.1: version "8.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" + resolved "http://localhost:4873/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== acorn@^8.4.1: version "8.8.2" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + resolved "http://localhost:4873/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== ansi-regex@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + resolved "http://localhost:4873/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== ansi-styles@^4.0.0: version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + resolved "http://localhost:4873/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== dependencies: color-convert "^2.0.1" anymatch@~3.1.2: version "3.1.3" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + resolved "http://localhost:4873/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== dependencies: normalize-path "^3.0.0" @@ -212,22 +211,22 @@ anymatch@~3.1.2: arg@^4.1.0: version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" + resolved "http://localhost:4873/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== balanced-match@^1.0.0: version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + resolved "http://localhost:4873/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== binary-extensions@^2.0.0: version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" + resolved "http://localhost:4873/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== brace-expansion@^1.1.7: version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + resolved "http://localhost:4873/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== dependencies: balanced-match "^1.0.0" @@ -235,24 +234,24 @@ brace-expansion@^1.1.7: braces@~3.0.2: version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + resolved "http://localhost:4873/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== dependencies: fill-range "^7.0.1" buffer-from@^1.0.0: version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" + resolved "http://localhost:4873/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== case-anything@^2.1.10: version "2.1.10" - resolved "https://registry.yarnpkg.com/case-anything/-/case-anything-2.1.10.tgz#d18a6ca968d54ec3421df71e3e190f3bced23410" + resolved "http://localhost:4873/case-anything/-/case-anything-2.1.10.tgz#d18a6ca968d54ec3421df71e3e190f3bced23410" integrity sha512-JczJwVrCP0jPKh05McyVsuOg6AYosrB9XWZKbQzXeDAm2ClE/PJE/BcrrQrVyGYH7Jg8V/LDupmyL4kFlVsVFQ== chokidar@^3.5.1: version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" + resolved "http://localhost:4873/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== dependencies: anymatch "~3.1.2" @@ -267,7 +266,7 @@ chokidar@^3.5.1: cliui@^7.0.2: version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" + resolved "http://localhost:4873/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== dependencies: string-width "^4.2.0" @@ -276,112 +275,112 @@ cliui@^7.0.2: color-convert@^2.0.1: version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + resolved "http://localhost:4873/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== dependencies: color-name "~1.1.4" color-name@~1.1.4: version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + resolved "http://localhost:4873/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== concat-map@0.0.1: version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + resolved "http://localhost:4873/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== create-require@^1.1.0: version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" + resolved "http://localhost:4873/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== dataloader@^1.4.0: version "1.4.0" - resolved "https://registry.yarnpkg.com/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8" + resolved "http://localhost:4873/dataloader/-/dataloader-1.4.0.tgz#bca11d867f5d3f1b9ed9f737bd15970c65dff5c8" integrity sha512-68s5jYdlvasItOJnCuI2Q9s4q98g0pCyL3HrcKJu8KNugUl8ahgmZYg38ysLTgQjjXX3H8CJLkAvWrclWfcalw== dayjs@^1.11.5: version "1.11.7" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" + resolved "http://localhost:4873/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2" integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ== detect-libc@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" + resolved "http://localhost:4873/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b" integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg== diff@^4.0.1: version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + resolved "http://localhost:4873/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== dotenv@^16.0.3: version "16.0.3" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07" + resolved "http://localhost:4873/dotenv/-/dotenv-16.0.3.tgz#115aec42bac5053db3c456db30cc243a5a836a07" integrity sha512-7GO6HghkA5fYG9TYnNxi14/7K9f5occMlp3zXAuSxn7CKCxt9xbNWG7yF8hTCSUchlfWSe3uLmlPfigevRItzQ== dprint-node@^1.0.7: version "1.0.7" - resolved "https://registry.yarnpkg.com/dprint-node/-/dprint-node-1.0.7.tgz#f571eaf61affb3a696cff1bdde78a021875ba540" + resolved "http://localhost:4873/dprint-node/-/dprint-node-1.0.7.tgz#f571eaf61affb3a696cff1bdde78a021875ba540" integrity sha512-NTZOW9A7ipb0n7z7nC3wftvsbceircwVHSgzobJsEQa+7RnOMbhrfX5IflA6CtC4GA63DSAiHYXa4JKEy9F7cA== dependencies: detect-libc "^1.0.3" dynamic-dedupe@^0.3.0: version "0.3.0" - resolved "https://registry.yarnpkg.com/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz#06e44c223f5e4e94d78ef9db23a6515ce2f962a1" + resolved "http://localhost:4873/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz#06e44c223f5e4e94d78ef9db23a6515ce2f962a1" integrity sha512-ssuANeD+z97meYOqd50e04Ze5qp4bPqo8cCkI4TRjZkzAUgIDTrXV1R8QCdINpiI+hw14+rYazvTRdQrz0/rFQ== dependencies: xtend "^4.0.0" emoji-regex@^8.0.0: version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" + resolved "http://localhost:4873/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== escalade@^3.1.1: version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + resolved "http://localhost:4873/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== fill-range@^7.0.1: version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + resolved "http://localhost:4873/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== dependencies: to-regex-range "^5.0.1" fs.realpath@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + resolved "http://localhost:4873/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== fsevents@~2.3.2: version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + resolved "http://localhost:4873/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== function-bind@^1.1.1: version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + resolved "http://localhost:4873/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== get-caller-file@^2.0.5: version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + resolved "http://localhost:4873/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== glob-parent@~5.1.2: version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + resolved "http://localhost:4873/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== dependencies: is-glob "^4.0.1" glob@^7.1.3: version "7.2.3" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + resolved "http://localhost:4873/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== dependencies: fs.realpath "^1.0.0" @@ -393,26 +392,26 @@ glob@^7.1.3: google-protobuf@^3.19.1: version "3.21.2" - resolved "https://registry.yarnpkg.com/google-protobuf/-/google-protobuf-3.21.2.tgz#4580a2bea8bbb291ee579d1fefb14d6fa3070ea4" + resolved "http://localhost:4873/google-protobuf/-/google-protobuf-3.21.2.tgz#4580a2bea8bbb291ee579d1fefb14d6fa3070ea4" integrity sha512-3MSOYFO5U9mPGikIYCzK0SaThypfGgS6bHqrUGXG3DPHCrb+txNqeEcns1W0lkGfk0rCyNXm7xB9rMxnCiZOoA== grpc-server-reflection@^0.1.5: version "0.1.5" - resolved "https://registry.yarnpkg.com/grpc-server-reflection/-/grpc-server-reflection-0.1.5.tgz#76ba71649fd71b0ebae7d5254ddc781ba61054d0" + resolved "http://localhost:4873/grpc-server-reflection/-/grpc-server-reflection-0.1.5.tgz#76ba71649fd71b0ebae7d5254ddc781ba61054d0" integrity sha512-i69RYu6v65enzknNAPUgerFuVQfo+L3n9g4c1A/Sv5jUHMpxMIjSbBA+YWls9Sr4Flac4oohp4Gx8f389CaHuw== dependencies: google-protobuf "^3.19.1" has@^1.0.3: version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + resolved "http://localhost:4873/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== dependencies: function-bind "^1.1.1" inflight@^1.0.4: version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + resolved "http://localhost:4873/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== dependencies: once "^1.3.0" @@ -420,122 +419,122 @@ inflight@^1.0.4: inherits@2: version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + resolved "http://localhost:4873/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== is-binary-path@~2.1.0: version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + resolved "http://localhost:4873/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== dependencies: binary-extensions "^2.0.0" is-core-module@^2.9.0: version "2.11.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" + resolved "http://localhost:4873/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== dependencies: has "^1.0.3" is-extglob@^2.1.1: version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + resolved "http://localhost:4873/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== is-fullwidth-code-point@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" + resolved "http://localhost:4873/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== is-glob@^4.0.1, is-glob@~4.0.1: version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + resolved "http://localhost:4873/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== dependencies: is-extglob "^2.1.1" is-number@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + resolved "http://localhost:4873/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== lodash.camelcase@^4.3.0: version "4.3.0" - resolved "https://registry.yarnpkg.com/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" + resolved "http://localhost:4873/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz#b28aa6288a2b9fc651035c7711f65ab6190331a6" integrity sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA== lodash@^4.17.21: version "4.17.21" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + resolved "http://localhost:4873/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== long@^4.0.0: version "4.0.0" - resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + resolved "http://localhost:4873/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== long@^5.0.0: version "5.2.1" - resolved "https://registry.yarnpkg.com/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" + resolved "http://localhost:4873/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A== make-error@^1.1.1: version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" + resolved "http://localhost:4873/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== minimatch@^3.1.1: version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + resolved "http://localhost:4873/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== dependencies: brace-expansion "^1.1.7" minimist@^1.2.6: version "1.2.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + resolved "http://localhost:4873/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== mkdirp@^1.0.4: version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + resolved "http://localhost:4873/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + resolved "http://localhost:4873/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== object-hash@^1.3.1: version "1.3.1" - resolved "https://registry.yarnpkg.com/object-hash/-/object-hash-1.3.1.tgz#fde452098a951cb145f039bb7d455449ddc126df" + resolved "http://localhost:4873/object-hash/-/object-hash-1.3.1.tgz#fde452098a951cb145f039bb7d455449ddc126df" integrity sha512-OSuu/pU4ENM9kmREg0BdNrUDIl1heYa4mBZacJc+vVWz4GtAwu7jO8s4AIt2aGRUTqxykpWzI3Oqnsm13tTMDA== once@^1.3.0: version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + resolved "http://localhost:4873/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== dependencies: wrappy "1" path-is-absolute@^1.0.0: version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + resolved "http://localhost:4873/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== path-parse@^1.0.7: version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + resolved "http://localhost:4873/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== picomatch@^2.0.4, picomatch@^2.2.1: version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + resolved "http://localhost:4873/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== protobufjs@^6.11.3, protobufjs@^6.8.8: version "6.11.3" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" + resolved "http://localhost:4873/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== dependencies: "@protobufjs/aspromise" "^1.1.2" @@ -554,7 +553,7 @@ protobufjs@^6.11.3, protobufjs@^6.8.8: protobufjs@^7.0.0: version "7.2.2" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.2.tgz#2af401d8c547b9476fb37ffc65782cf302342ca3" + resolved "http://localhost:4873/protobufjs/-/protobufjs-7.2.2.tgz#2af401d8c547b9476fb37ffc65782cf302342ca3" integrity sha512-++PrQIjrom+bFDPpfmqXfAGSQs40116JRrqqyf53dymUMvvb5d/LMRyicRoF1AUKoXVS1/IgJXlEgcpr4gTF3Q== dependencies: "@protobufjs/aspromise" "^1.1.2" @@ -572,19 +571,19 @@ protobufjs@^7.0.0: readdirp@~3.6.0: version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + resolved "http://localhost:4873/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== dependencies: picomatch "^2.2.1" require-directory@^2.1.1: version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + resolved "http://localhost:4873/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== resolve@^1.0.0: version "1.22.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + resolved "http://localhost:4873/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== dependencies: is-core-module "^2.9.0" @@ -593,21 +592,21 @@ resolve@^1.0.0: rimraf@^2.6.1: version "2.7.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + resolved "http://localhost:4873/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== dependencies: glob "^7.1.3" rimraf@^3.0.2: version "3.0.2" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + resolved "http://localhost:4873/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== dependencies: glob "^7.1.3" source-map-support@^0.5.12, source-map-support@^0.5.21: version "0.5.21" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" + resolved "http://localhost:4873/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== dependencies: buffer-from "^1.0.0" @@ -615,12 +614,12 @@ source-map-support@^0.5.12, source-map-support@^0.5.21: source-map@^0.6.0: version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + resolved "http://localhost:4873/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" + resolved "http://localhost:4873/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== dependencies: emoji-regex "^8.0.0" @@ -629,49 +628,49 @@ string-width@^4.1.0, string-width@^4.2.0: strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + resolved "http://localhost:4873/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" strip-bom@^3.0.0: version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + resolved "http://localhost:4873/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== strip-json-comments@^2.0.0: version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" + resolved "http://localhost:4873/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" integrity sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ== supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + resolved "http://localhost:4873/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== to-regex-range@^5.0.1: version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + resolved "http://localhost:4873/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== dependencies: is-number "^7.0.0" -"topcoder-interface@github:topcoder-platform/plat-interface-definition#v0.0.10": - version "1.0.0" - resolved "https://codeload.github.com/topcoder-platform/plat-interface-definition/tar.gz/83db3ad5ac053393f8d9aa975dfe067fd8942add" - "topcoder-interface@github:topcoder-platform/plat-interface-definition#v0.0.11": version "1.0.0" resolved "https://codeload.github.com/topcoder-platform/plat-interface-definition/tar.gz/ef173ab2efd5f7a015d2b64412cab082c78221c7" +"topcoder-interface@github:topcoder-platform/plat-interface-definition#v0.0.18": + version "1.0.0" + resolved "https://codeload.github.com/topcoder-platform/plat-interface-definition/tar.gz/9f2a79c1fdba9b3e96a8cbcd4ad26203eefb0320" + tree-kill@^1.2.2: version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" + resolved "http://localhost:4873/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== ts-node-dev@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/ts-node-dev/-/ts-node-dev-2.0.0.tgz#bdd53e17ab3b5d822ef519928dc6b4a7e0f13065" + resolved "http://localhost:4873/ts-node-dev/-/ts-node-dev-2.0.0.tgz#bdd53e17ab3b5d822ef519928dc6b4a7e0f13065" integrity sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w== dependencies: chokidar "^3.5.1" @@ -687,7 +686,7 @@ ts-node-dev@^2.0.0: ts-node@^10.4.0: version "10.9.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" + resolved "http://localhost:4873/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== dependencies: "@cspotcode/source-map-support" "^0.8.0" @@ -706,23 +705,23 @@ ts-node@^10.4.0: ts-poet@^6.2.0: version "6.3.0" - resolved "https://registry.yarnpkg.com/ts-poet/-/ts-poet-6.3.0.tgz#954f2a6923ccaa2d4cdf55979f2e991d440e30a3" + resolved "http://localhost:4873/ts-poet/-/ts-poet-6.3.0.tgz#954f2a6923ccaa2d4cdf55979f2e991d440e30a3" integrity sha512-RjS37SnXMa9En8xvQf//+rvNNNCB7x2TKP/ZfsiQFidtfN3A6FYgPDESe4r7YA3F663XO2ozx+2buQItGOLMxg== dependencies: dprint-node "^1.0.7" ts-proto-descriptors@1.7.1: version "1.7.1" - resolved "https://registry.yarnpkg.com/ts-proto-descriptors/-/ts-proto-descriptors-1.7.1.tgz#685d00305b06adfa929fd5a016a419382cd64c50" + resolved "http://localhost:4873/ts-proto-descriptors/-/ts-proto-descriptors-1.7.1.tgz#685d00305b06adfa929fd5a016a419382cd64c50" integrity sha512-oIKUh3K4Xts4v29USGLfUG+2mEk32MsqpgZAOUyUlkrcIdv34yE+k2oZ2Nzngm6cV/JgFdOxRCqeyvmWHuYAyw== dependencies: long "^4.0.0" protobufjs "^6.8.8" ts-proto@^1.126.1: - version "1.139.0" - resolved "https://registry.yarnpkg.com/ts-proto/-/ts-proto-1.139.0.tgz#de681b59aae145fc2e55cbb00f7fdb5846e8dbc6" - integrity sha512-DXfRVbsEnzan/tpb7RxuJOgjhzwuxDsyXbYSnF8JHCIDcJ/JxeqeUyDUVICFGmgqrsPcnjn5t3iqOUZRNRm9tg== + version "1.140.0" + resolved "http://localhost:4873/ts-proto/-/ts-proto-1.140.0.tgz#cb1528cd5945a4de0ef50637beabf6a70d039f4a" + integrity sha512-0FhFT+S8u7ES3O6b+yEQJ3eSOtW1Sp9F5b4TAfsIs+ojQozghz8Zr5dTHXcuibwoUIZibzt45OxvXLhmJyFMMQ== dependencies: "@types/object-hash" "^1.3.0" case-anything "^2.1.10" @@ -734,7 +733,7 @@ ts-proto@^1.126.1: tsconfig@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-7.0.0.tgz#84538875a4dc216e5c4a5432b3a4dec3d54e91b7" + resolved "http://localhost:4873/tsconfig/-/tsconfig-7.0.0.tgz#84538875a4dc216e5c4a5432b3a4dec3d54e91b7" integrity sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw== dependencies: "@types/strip-bom" "^3.0.0" @@ -744,22 +743,22 @@ tsconfig@^7.0.0: tslib@^2.4.1: version "2.5.0" - resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" + resolved "http://localhost:4873/tslib/-/tslib-2.5.0.tgz#42bfed86f5787aeb41d031866c8f402429e0fddf" integrity sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg== typescript@^4.9.4: version "4.9.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" + resolved "http://localhost:4873/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a" integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== uuid@8.3.2: version "8.3.2" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" + resolved "http://localhost:4873/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== uuidv4@^6.2.13: version "6.2.13" - resolved "https://registry.yarnpkg.com/uuidv4/-/uuidv4-6.2.13.tgz#8f95ec5ef22d1f92c8e5d4c70b735d1c89572cb7" + resolved "http://localhost:4873/uuidv4/-/uuidv4-6.2.13.tgz#8f95ec5ef22d1f92c8e5d4c70b735d1c89572cb7" integrity sha512-AXyzMjazYB3ovL3q051VLH06Ixj//Knx7QnUSi1T//Ie3io6CpsPu9nVMOx5MoLWh6xV0B9J0hIaxungxXUbPQ== dependencies: "@types/uuid" "8.3.4" @@ -767,12 +766,12 @@ uuidv4@^6.2.13: v8-compile-cache-lib@^3.0.1: version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" + resolved "http://localhost:4873/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== wrap-ansi@^7.0.0: version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" + resolved "http://localhost:4873/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== dependencies: ansi-styles "^4.0.0" @@ -781,27 +780,27 @@ wrap-ansi@^7.0.0: wrappy@1: version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + resolved "http://localhost:4873/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== xtend@^4.0.0: version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" + resolved "http://localhost:4873/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== y18n@^5.0.5: version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" + resolved "http://localhost:4873/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== yargs-parser@^20.2.2: version "20.2.9" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" + resolved "http://localhost:4873/yargs-parser/-/yargs-parser-20.2.9.tgz#2eb7dc3b0289718fc295f362753845c41a0c94ee" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== yargs@^16.2.0: version "16.2.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" + resolved "http://localhost:4873/yargs/-/yargs-16.2.0.tgz#1c82bf0f6b6a66eafce7ef30e376f49a12477f66" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== dependencies: cliui "^7.0.2" @@ -814,5 +813,5 @@ yargs@^16.2.0: yn@3.1.1: version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" + resolved "http://localhost:4873/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== From 58181c427aab81643b35e9ef4ae7c96d78b49d3d Mon Sep 17 00:00:00 2001 From: Hamid Tavakoli Date: Sun, 5 Mar 2023 22:58:30 -0800 Subject: [PATCH 2/8] fix: move to domain-submission --- package.json | 1 + src/config.ts | 6 +- src/domain/LegacySubmission.ts | 12 +-- src/helper/helper.ts | 8 ++ src/models/domain-layer/legacy/submission.ts | 87 ++++++++++++++++---- src/server.ts | 5 +- yarn.lock | 13 ++- 7 files changed, 101 insertions(+), 31 deletions(-) create mode 100644 src/helper/helper.ts diff --git a/package.json b/package.json index acd5868..83267dc 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "dependencies": { "@grpc/grpc-js": "^1.7.1", "@topcoder-framework/client-relational": "^0.4.3", + "@topcoder-framework/domain-challenge": "^0.5.1-ci.0", "@topcoder-framework/lib-common": "^0.4.3", "dayjs": "^1.11.5", "dotenv": "^16.0.3", diff --git a/src/config.ts b/src/config.ts index 27ee29d..a1215b8 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,13 +1,11 @@ -import * as dotenv from "dotenv"; import assert from "assert"; -dotenv.config(); export const ENV = process.env.ENV || "local"; -export const GRPC_SERVER_HOST = process.env.GRPC_SERVER_HOST || ""; +export const GRPC_SERVER_HOST = process.env.GRPC_SERVER_HOST || "localhost"; export const GRPC_SERVER_PORT = process.env.GRPC_SERVER_PORT || 9091; export const GRPC_RDB_SERVER_HOST = process.env.GRPC_RDB_SERVER_HOST; export const GRPC_RDB_SERVER_PORT = process.env.GRPC_RDB_SERVER_PORT; assert(GRPC_RDB_SERVER_HOST, "GRPC_RDB_SERVER_HOST is required"); -assert(GRPC_RDB_SERVER_PORT, "GRPC_RDB_SERVER_PORT is required"); \ No newline at end of file +assert(GRPC_RDB_SERVER_PORT, "GRPC_RDB_SERVER_PORT is required"); diff --git a/src/domain/LegacySubmission.ts b/src/domain/LegacySubmission.ts index 4ac999c..4255999 100644 --- a/src/domain/LegacySubmission.ts +++ b/src/domain/LegacySubmission.ts @@ -1,14 +1,11 @@ import { Operator, QueryBuilder } from "@topcoder-framework/client-relational"; +import { ChallengeDomain } from "@topcoder-framework/domain-challenge"; +import { isUuid } from "../helper/helper"; import { queryRunner } from "../helper/QueryRunner"; -import { - CreateSubmissionInput, -} from "../models/domain-layer/legacy/submission"; +import { CreateSubmissionInput } from "../models/domain-layer/legacy/submission"; import { ProjectSchema } from "../schema/project/Project"; - class LegacySubmissionDomain { - public async checkSubmissionExists( - legacySubmissionId: number - ): Promise { + public async checkSubmissionExists(legacySubmissionId: number): Promise { const { projectId } = ProjectSchema.columns; const query = new QueryBuilder(ProjectSchema) @@ -43,7 +40,6 @@ class LegacySubmissionDomain { modifyDate: input.modifyDate, }) .build(); - const createLegacySubmissionQueryResult = await transaction.add(createLegacySubmissionQuery); if (createLegacySubmissionQueryResult instanceof Error) { transaction.rollback(); diff --git a/src/helper/helper.ts b/src/helper/helper.ts new file mode 100644 index 0000000..0627ec5 --- /dev/null +++ b/src/helper/helper.ts @@ -0,0 +1,8 @@ +/** + * Test if the id is UUID + * @param {String} id the id + * @returns {Boolean} true if it's a uuid + */ +export function isUuid(id: string) { + return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-5][0-9a-f]{3}-[089ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(id); +} diff --git a/src/models/domain-layer/legacy/submission.ts b/src/models/domain-layer/legacy/submission.ts index 1f69d50..132c894 100644 --- a/src/models/domain-layer/legacy/submission.ts +++ b/src/models/domain-layer/legacy/submission.ts @@ -11,6 +11,7 @@ export interface LegacySubmission { createDate: number; modifyUser: number; modifyDate: number; + submissionPhaseId: string; } export interface LegacySubmissionId { @@ -29,6 +30,7 @@ export interface CreateSubmissionInput { createDate: number; modifyUser: number; modifyDate: number; + submissionPhaseId: string; } export interface UpdateSubmissionInput { @@ -40,6 +42,7 @@ export interface UpdateSubmissionInput { createDate: number; modifyUser: number; modifyDate: number; + submissionPhaseId: string; } function createBaseLegacySubmission(): LegacySubmission { @@ -52,6 +55,7 @@ function createBaseLegacySubmission(): LegacySubmission { createDate: 0, modifyUser: 0, modifyDate: 0, + submissionPhaseId: "", }; } @@ -81,6 +85,9 @@ export const LegacySubmission = { if (message.modifyDate !== 0) { writer.uint32(64).int64(message.modifyDate); } + if (message.submissionPhaseId !== "") { + writer.uint32(74).string(message.submissionPhaseId); + } return writer; }, @@ -115,6 +122,9 @@ export const LegacySubmission = { case 8: message.modifyDate = longToNumber(reader.int64() as Long); break; + case 9: + message.submissionPhaseId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -133,19 +143,23 @@ export const LegacySubmission = { createDate: isSet(object.createDate) ? Number(object.createDate) : 0, modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + submissionPhaseId: isSet(object.submissionPhaseId) ? String(object.submissionPhaseId) : "", }; }, toJSON(message: LegacySubmission): unknown { const obj: any = {}; message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); - message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); - message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); + message.submissionStatusId !== undefined && + (obj.submissionStatusId = Math.round(message.submissionStatusId)); + message.submissionTypeId !== undefined && + (obj.submissionTypeId = Math.round(message.submissionTypeId)); message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + message.submissionPhaseId !== undefined && (obj.submissionPhaseId = message.submissionPhaseId); return obj; }, @@ -163,6 +177,7 @@ export const LegacySubmission = { message.createDate = object.createDate ?? 0; message.modifyUser = object.modifyUser ?? 0; message.modifyDate = object.modifyDate ?? 0; + message.submissionPhaseId = object.submissionPhaseId ?? ""; return message; }, }; @@ -259,7 +274,9 @@ export const LegacySubmissionList = { toJSON(message: LegacySubmissionList): unknown { const obj: any = {}; if (message.legacySubmissions) { - obj.legacySubmissions = message.legacySubmissions.map((e) => e ? LegacySubmission.toJSON(e) : undefined); + obj.legacySubmissions = message.legacySubmissions.map((e) => + e ? LegacySubmission.toJSON(e) : undefined + ); } else { obj.legacySubmissions = []; } @@ -270,9 +287,12 @@ export const LegacySubmissionList = { return LegacySubmissionList.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): LegacySubmissionList { + fromPartial, I>>( + object: I + ): LegacySubmissionList { const message = createBaseLegacySubmissionList(); - message.legacySubmissions = object.legacySubmissions?.map((e) => LegacySubmission.fromPartial(e)) || []; + message.legacySubmissions = + object.legacySubmissions?.map((e) => LegacySubmission.fromPartial(e)) || []; return message; }, }; @@ -286,6 +306,7 @@ function createBaseCreateSubmissionInput(): CreateSubmissionInput { createDate: 0, modifyUser: 0, modifyDate: 0, + submissionPhaseId: "", }; } @@ -312,6 +333,9 @@ export const CreateSubmissionInput = { if (message.modifyDate !== 0) { writer.uint32(56).int64(message.modifyDate); } + if (message.submissionPhaseId !== "") { + writer.uint32(74).string(message.submissionPhaseId); + } return writer; }, @@ -343,6 +367,9 @@ export const CreateSubmissionInput = { case 7: message.modifyDate = longToNumber(reader.int64() as Long); break; + case 9: + message.submissionPhaseId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -360,18 +387,22 @@ export const CreateSubmissionInput = { createDate: isSet(object.createDate) ? Number(object.createDate) : 0, modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + submissionPhaseId: isSet(object.submissionPhaseId) ? String(object.submissionPhaseId) : "", }; }, toJSON(message: CreateSubmissionInput): unknown { const obj: any = {}; - message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); - message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); + message.submissionStatusId !== undefined && + (obj.submissionStatusId = Math.round(message.submissionStatusId)); + message.submissionTypeId !== undefined && + (obj.submissionTypeId = Math.round(message.submissionTypeId)); message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + message.submissionPhaseId !== undefined && (obj.submissionPhaseId = message.submissionPhaseId); return obj; }, @@ -379,7 +410,9 @@ export const CreateSubmissionInput = { return CreateSubmissionInput.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): CreateSubmissionInput { + fromPartial, I>>( + object: I + ): CreateSubmissionInput { const message = createBaseCreateSubmissionInput(); message.submissionStatusId = object.submissionStatusId ?? 0; message.submissionTypeId = object.submissionTypeId ?? 0; @@ -388,6 +421,7 @@ export const CreateSubmissionInput = { message.createDate = object.createDate ?? 0; message.modifyUser = object.modifyUser ?? 0; message.modifyDate = object.modifyDate ?? 0; + message.submissionPhaseId = object.submissionPhaseId ?? ""; return message; }, }; @@ -402,6 +436,7 @@ function createBaseUpdateSubmissionInput(): UpdateSubmissionInput { createDate: 0, modifyUser: 0, modifyDate: 0, + submissionPhaseId: "", }; } @@ -431,6 +466,9 @@ export const UpdateSubmissionInput = { if (message.modifyDate !== 0) { writer.uint32(64).int64(message.modifyDate); } + if (message.submissionPhaseId !== "") { + writer.uint32(74).string(message.submissionPhaseId); + } return writer; }, @@ -465,6 +503,9 @@ export const UpdateSubmissionInput = { case 8: message.modifyDate = longToNumber(reader.int64() as Long); break; + case 9: + message.submissionPhaseId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -483,19 +524,23 @@ export const UpdateSubmissionInput = { createDate: isSet(object.createDate) ? Number(object.createDate) : 0, modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + submissionPhaseId: isSet(object.submissionPhaseId) ? String(object.submissionPhaseId) : "", }; }, toJSON(message: UpdateSubmissionInput): unknown { const obj: any = {}; message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); - message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); - message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); + message.submissionStatusId !== undefined && + (obj.submissionStatusId = Math.round(message.submissionStatusId)); + message.submissionTypeId !== undefined && + (obj.submissionTypeId = Math.round(message.submissionTypeId)); message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + message.submissionPhaseId !== undefined && (obj.submissionPhaseId = message.submissionPhaseId); return obj; }, @@ -503,7 +548,9 @@ export const UpdateSubmissionInput = { return UpdateSubmissionInput.fromPartial(base ?? {}); }, - fromPartial, I>>(object: I): UpdateSubmissionInput { + fromPartial, I>>( + object: I + ): UpdateSubmissionInput { const message = createBaseUpdateSubmissionInput(); message.submissionId = object.submissionId ?? 0; message.submissionStatusId = object.submissionStatusId ?? 0; @@ -513,6 +560,7 @@ export const UpdateSubmissionInput = { message.createDate = object.createDate ?? 0; message.modifyUser = object.modifyUser ?? 0; message.modifyDate = object.modifyDate ?? 0; + message.submissionPhaseId = object.submissionPhaseId ?? ""; return message; }, }; @@ -538,14 +586,21 @@ var tsProtoGlobalThis: any = (() => { type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; -type DeepPartial = T extends Builtin ? T - : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> - : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } - : T extends {} ? { [K in keyof T]?: DeepPartial } +type DeepPartial = T extends Builtin + ? T + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends { $case: string } + ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} + ? { [K in keyof T]?: DeepPartial } : Partial; type KeysOfUnion = T extends T ? keyof T : never; -type Exact = P extends Builtin ? P +type Exact = P extends Builtin + ? P : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; function longToNumber(long: Long): number { diff --git a/src/server.ts b/src/server.ts index e163d9f..50b7b0b 100644 --- a/src/server.ts +++ b/src/server.ts @@ -1,6 +1,7 @@ -import "source-map-support/register"; - +import * as dotenv from "dotenv"; import * as path from "path"; +import "source-map-support/register"; +dotenv.config(); import { Server, ServerCredentials } from "@grpc/grpc-js"; import { addReflection } from "grpc-server-reflection"; diff --git a/yarn.lock b/yarn.lock index 414e89d..db37150 100644 --- a/yarn.lock +++ b/yarn.lock @@ -351,7 +351,7 @@ resolved "http://localhost:4873/@protobufjs%2futf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== -"@topcoder-framework/client-relational@^0.4.3": +"@topcoder-framework/client-relational@^0.4.3", "@topcoder-framework/client-relational@^0.5.0": version "0.5.1-ci.0" resolved "http://localhost:4873/@topcoder-framework%2fclient-relational/-/client-relational-0.5.1-ci.0.tgz#d89d639139bbb9e338811c15f93b536566e3d243" integrity sha512-9vkNoYwssv91IZ5lS6Y7IRE6qqtdCLQbbYpQNnFuvhPpmrFcbeGeZ3Nl/KOV6ocRtBcxWvpTLO8VYojYIdkEYA== @@ -361,6 +361,17 @@ topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.18" tslib "^2.4.1" +"@topcoder-framework/domain-challenge@^0.5.1-ci.0": + version "0.5.1-ci.0" + resolved "http://localhost:4873/@topcoder-framework%2fdomain-challenge/-/domain-challenge-0.5.1-ci.0.tgz#3700494ab7a25405045f210929656e7fd22c8def" + integrity sha512-4fNL4K4JE6EmkWa061kE8BkL9gBo6rtpfbcaJsD/u7Kh/7ja1Yb/IJT3D77y5sYaMF6u9Tzs8cAG7lXwET7WyQ== + dependencies: + "@grpc/grpc-js" "^1.8.0" + "@topcoder-framework/client-relational" "^0.5.0" + "@topcoder-framework/lib-common" "0.5.1-ci.0" + topcoder-interface "github:topcoder-platform/plat-interface-definition#v0.0.18" + tslib "^2.4.1" + "@topcoder-framework/lib-common@0.5.1-ci.0", "@topcoder-framework/lib-common@^0.4.3": version "0.5.1-ci.0" resolved "http://localhost:4873/@topcoder-framework%2flib-common/-/lib-common-0.5.1-ci.0.tgz#1a29e542a9cde7935b776500f25651d1cbdbccc1" From a368d796748939eaa9d90872c632592bb3b5524c Mon Sep 17 00:00:00 2001 From: Thomas Kranitsas Date: Tue, 7 Mar 2023 16:21:24 +0200 Subject: [PATCH 3/8] feat: submission.update, reviewSummation --- src/domain/LegacySubmission.ts | 19 +- src/domain/LegacyUpload.ts | 24 + .../legacy/long_component_state.ts | 362 +++++++++++ .../domain-layer/legacy/long_submission.ts | 311 ++++++++++ .../domain-layer/legacy/round_registration.ts | 214 +++++++ .../legacy/services/long_component_state.ts | 57 ++ .../legacy/services/long_submission.ts | 32 + .../legacy/services/resource_submission.ts | 42 ++ .../legacy/services/round_registration.ts | 32 + .../legacy/services/submission.ts | 46 +- .../domain-layer/legacy/services/upload.ts | 68 +++ src/models/domain-layer/legacy/submission.ts | 417 ++++++------- src/models/domain-layer/legacy/upload.ts | 570 ++++++++++++++++++ src/schema/submission/Submission.ts | 21 + src/schema/submission/Upload.ts | 22 + src/server.ts | 2 + src/service/LegacySubmission.ts | 8 +- src/service/LegacyUpload.ts | 52 ++ 18 files changed, 2057 insertions(+), 242 deletions(-) create mode 100644 src/domain/LegacyUpload.ts create mode 100644 src/models/domain-layer/legacy/long_component_state.ts create mode 100644 src/models/domain-layer/legacy/long_submission.ts create mode 100644 src/models/domain-layer/legacy/round_registration.ts create mode 100644 src/models/domain-layer/legacy/services/long_component_state.ts create mode 100644 src/models/domain-layer/legacy/services/long_submission.ts create mode 100644 src/models/domain-layer/legacy/services/resource_submission.ts create mode 100644 src/models/domain-layer/legacy/services/round_registration.ts create mode 100644 src/models/domain-layer/legacy/services/upload.ts create mode 100644 src/models/domain-layer/legacy/upload.ts create mode 100644 src/schema/submission/Submission.ts create mode 100644 src/schema/submission/Upload.ts create mode 100644 src/service/LegacyUpload.ts diff --git a/src/domain/LegacySubmission.ts b/src/domain/LegacySubmission.ts index 4ac999c..ca12617 100644 --- a/src/domain/LegacySubmission.ts +++ b/src/domain/LegacySubmission.ts @@ -1,9 +1,12 @@ -import { Operator, QueryBuilder } from "@topcoder-framework/client-relational"; +import { Operator, Query, QueryBuilder } from "@topcoder-framework/client-relational"; +import { UpdateResult, Value } from "@topcoder-framework/lib-common"; +import { Util } from "../common/Util"; import { queryRunner } from "../helper/QueryRunner"; import { - CreateSubmissionInput, + CreateSubmissionInput, UpdateSubmissionInput, } from "../models/domain-layer/legacy/submission"; import { ProjectSchema } from "../schema/project/Project"; +import { LegacySubmissionSchema } from "../schema/submission/Submission"; class LegacySubmissionDomain { public async checkSubmissionExists( @@ -93,6 +96,18 @@ class LegacySubmissionDomain { // }; // return Promise.resolve(10); // } + + public async update(input: UpdateSubmissionInput): Promise { + const query: Query = new QueryBuilder(LegacySubmissionSchema) + .update({ ...input }) + .where(...Util.toScanCriteria({ ...input } as { [key: string]: number|string|undefined })) + .build(); + + const { affectedRows } = await queryRunner.run(query); + return { + updatedCount: affectedRows || 0, + } + } } export default new LegacySubmissionDomain(); diff --git a/src/domain/LegacyUpload.ts b/src/domain/LegacyUpload.ts new file mode 100644 index 0000000..d8d204e --- /dev/null +++ b/src/domain/LegacyUpload.ts @@ -0,0 +1,24 @@ +import { Query, QueryBuilder } from "@topcoder-framework/client-relational"; +import { UpdateResult } from "@topcoder-framework/lib-common"; +import { Util } from "../common/Util"; +import { queryRunner } from "../helper/QueryRunner"; +import { + UpdateUploadInput, +} from "../models/domain-layer/legacy/upload"; +import { UploadSchema } from "../schema/submission/Upload"; + +class LegacySubmissionDomain { + public async update(input: UpdateUploadInput): Promise { + const query: Query = new QueryBuilder(UploadSchema) + .update({ ...input }) + .where(...Util.toScanCriteria({ ...input } as { [key: string]: number|string|undefined })) + .build(); + + const { affectedRows } = await queryRunner.run(query); + return { + updatedCount: affectedRows || 0, + } + } +} + +export default new LegacySubmissionDomain(); diff --git a/src/models/domain-layer/legacy/long_component_state.ts b/src/models/domain-layer/legacy/long_component_state.ts new file mode 100644 index 0000000..6a44a15 --- /dev/null +++ b/src/models/domain-layer/legacy/long_component_state.ts @@ -0,0 +1,362 @@ +/* eslint-disable */ +import _m0 from "protobufjs/minimal"; + +export interface LongComponentState { + longComponentStateId: number; + roundId: number; + coderId: number; + componentId: number; + points: number; + statusId: number; + submissionNumber: number; + exampleSubmissionNumber: number; +} + +export interface CreateLongComponentStateInput { + roundId: number; + coderId: number; + componentId: number; + points: number; + statusId: number; + submissionNumber: number; + exampleSubmissionNumber: number; +} + +export interface UpdateLongComponentStateInput { + longComponentStateId: number; + submissionNumber?: number | undefined; + points?: number | undefined; +} + +function createBaseLongComponentState(): LongComponentState { + return { + longComponentStateId: 0, + roundId: 0, + coderId: 0, + componentId: 0, + points: 0, + statusId: 0, + submissionNumber: 0, + exampleSubmissionNumber: 0, + }; +} + +export const LongComponentState = { + encode(message: LongComponentState, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.longComponentStateId !== 0) { + writer.uint32(8).int32(message.longComponentStateId); + } + if (message.roundId !== 0) { + writer.uint32(16).int32(message.roundId); + } + if (message.coderId !== 0) { + writer.uint32(24).int32(message.coderId); + } + if (message.componentId !== 0) { + writer.uint32(32).int32(message.componentId); + } + if (message.points !== 0) { + writer.uint32(40).int32(message.points); + } + if (message.statusId !== 0) { + writer.uint32(48).int32(message.statusId); + } + if (message.submissionNumber !== 0) { + writer.uint32(56).int32(message.submissionNumber); + } + if (message.exampleSubmissionNumber !== 0) { + writer.uint32(64).int32(message.exampleSubmissionNumber); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LongComponentState { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLongComponentState(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.longComponentStateId = reader.int32(); + break; + case 2: + message.roundId = reader.int32(); + break; + case 3: + message.coderId = reader.int32(); + break; + case 4: + message.componentId = reader.int32(); + break; + case 5: + message.points = reader.int32(); + break; + case 6: + message.statusId = reader.int32(); + break; + case 7: + message.submissionNumber = reader.int32(); + break; + case 8: + message.exampleSubmissionNumber = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LongComponentState { + return { + longComponentStateId: isSet(object.longComponentStateId) ? Number(object.longComponentStateId) : 0, + roundId: isSet(object.roundId) ? Number(object.roundId) : 0, + coderId: isSet(object.coderId) ? Number(object.coderId) : 0, + componentId: isSet(object.componentId) ? Number(object.componentId) : 0, + points: isSet(object.points) ? Number(object.points) : 0, + statusId: isSet(object.statusId) ? Number(object.statusId) : 0, + submissionNumber: isSet(object.submissionNumber) ? Number(object.submissionNumber) : 0, + exampleSubmissionNumber: isSet(object.exampleSubmissionNumber) ? Number(object.exampleSubmissionNumber) : 0, + }; + }, + + toJSON(message: LongComponentState): unknown { + const obj: any = {}; + message.longComponentStateId !== undefined && (obj.longComponentStateId = Math.round(message.longComponentStateId)); + message.roundId !== undefined && (obj.roundId = Math.round(message.roundId)); + message.coderId !== undefined && (obj.coderId = Math.round(message.coderId)); + message.componentId !== undefined && (obj.componentId = Math.round(message.componentId)); + message.points !== undefined && (obj.points = Math.round(message.points)); + message.statusId !== undefined && (obj.statusId = Math.round(message.statusId)); + message.submissionNumber !== undefined && (obj.submissionNumber = Math.round(message.submissionNumber)); + message.exampleSubmissionNumber !== undefined && + (obj.exampleSubmissionNumber = Math.round(message.exampleSubmissionNumber)); + return obj; + }, + + create, I>>(base?: I): LongComponentState { + return LongComponentState.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): LongComponentState { + const message = createBaseLongComponentState(); + message.longComponentStateId = object.longComponentStateId ?? 0; + message.roundId = object.roundId ?? 0; + message.coderId = object.coderId ?? 0; + message.componentId = object.componentId ?? 0; + message.points = object.points ?? 0; + message.statusId = object.statusId ?? 0; + message.submissionNumber = object.submissionNumber ?? 0; + message.exampleSubmissionNumber = object.exampleSubmissionNumber ?? 0; + return message; + }, +}; + +function createBaseCreateLongComponentStateInput(): CreateLongComponentStateInput { + return { + roundId: 0, + coderId: 0, + componentId: 0, + points: 0, + statusId: 0, + submissionNumber: 0, + exampleSubmissionNumber: 0, + }; +} + +export const CreateLongComponentStateInput = { + encode(message: CreateLongComponentStateInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.roundId !== 0) { + writer.uint32(8).int32(message.roundId); + } + if (message.coderId !== 0) { + writer.uint32(16).int32(message.coderId); + } + if (message.componentId !== 0) { + writer.uint32(24).int32(message.componentId); + } + if (message.points !== 0) { + writer.uint32(32).int32(message.points); + } + if (message.statusId !== 0) { + writer.uint32(40).int32(message.statusId); + } + if (message.submissionNumber !== 0) { + writer.uint32(48).int32(message.submissionNumber); + } + if (message.exampleSubmissionNumber !== 0) { + writer.uint32(56).int32(message.exampleSubmissionNumber); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateLongComponentStateInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateLongComponentStateInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.roundId = reader.int32(); + break; + case 2: + message.coderId = reader.int32(); + break; + case 3: + message.componentId = reader.int32(); + break; + case 4: + message.points = reader.int32(); + break; + case 5: + message.statusId = reader.int32(); + break; + case 6: + message.submissionNumber = reader.int32(); + break; + case 7: + message.exampleSubmissionNumber = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateLongComponentStateInput { + return { + roundId: isSet(object.roundId) ? Number(object.roundId) : 0, + coderId: isSet(object.coderId) ? Number(object.coderId) : 0, + componentId: isSet(object.componentId) ? Number(object.componentId) : 0, + points: isSet(object.points) ? Number(object.points) : 0, + statusId: isSet(object.statusId) ? Number(object.statusId) : 0, + submissionNumber: isSet(object.submissionNumber) ? Number(object.submissionNumber) : 0, + exampleSubmissionNumber: isSet(object.exampleSubmissionNumber) ? Number(object.exampleSubmissionNumber) : 0, + }; + }, + + toJSON(message: CreateLongComponentStateInput): unknown { + const obj: any = {}; + message.roundId !== undefined && (obj.roundId = Math.round(message.roundId)); + message.coderId !== undefined && (obj.coderId = Math.round(message.coderId)); + message.componentId !== undefined && (obj.componentId = Math.round(message.componentId)); + message.points !== undefined && (obj.points = Math.round(message.points)); + message.statusId !== undefined && (obj.statusId = Math.round(message.statusId)); + message.submissionNumber !== undefined && (obj.submissionNumber = Math.round(message.submissionNumber)); + message.exampleSubmissionNumber !== undefined && + (obj.exampleSubmissionNumber = Math.round(message.exampleSubmissionNumber)); + return obj; + }, + + create, I>>(base?: I): CreateLongComponentStateInput { + return CreateLongComponentStateInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): CreateLongComponentStateInput { + const message = createBaseCreateLongComponentStateInput(); + message.roundId = object.roundId ?? 0; + message.coderId = object.coderId ?? 0; + message.componentId = object.componentId ?? 0; + message.points = object.points ?? 0; + message.statusId = object.statusId ?? 0; + message.submissionNumber = object.submissionNumber ?? 0; + message.exampleSubmissionNumber = object.exampleSubmissionNumber ?? 0; + return message; + }, +}; + +function createBaseUpdateLongComponentStateInput(): UpdateLongComponentStateInput { + return { longComponentStateId: 0, submissionNumber: undefined, points: undefined }; +} + +export const UpdateLongComponentStateInput = { + encode(message: UpdateLongComponentStateInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.longComponentStateId !== 0) { + writer.uint32(8).int32(message.longComponentStateId); + } + if (message.submissionNumber !== undefined) { + writer.uint32(16).int32(message.submissionNumber); + } + if (message.points !== undefined) { + writer.uint32(24).int32(message.points); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateLongComponentStateInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateLongComponentStateInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.longComponentStateId = reader.int32(); + break; + case 2: + message.submissionNumber = reader.int32(); + break; + case 3: + message.points = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateLongComponentStateInput { + return { + longComponentStateId: isSet(object.longComponentStateId) ? Number(object.longComponentStateId) : 0, + submissionNumber: isSet(object.submissionNumber) ? Number(object.submissionNumber) : undefined, + points: isSet(object.points) ? Number(object.points) : undefined, + }; + }, + + toJSON(message: UpdateLongComponentStateInput): unknown { + const obj: any = {}; + message.longComponentStateId !== undefined && (obj.longComponentStateId = Math.round(message.longComponentStateId)); + message.submissionNumber !== undefined && (obj.submissionNumber = Math.round(message.submissionNumber)); + message.points !== undefined && (obj.points = Math.round(message.points)); + return obj; + }, + + create, I>>(base?: I): UpdateLongComponentStateInput { + return UpdateLongComponentStateInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): UpdateLongComponentStateInput { + const message = createBaseUpdateLongComponentStateInput(); + message.longComponentStateId = object.longComponentStateId ?? 0; + message.submissionNumber = object.submissionNumber ?? undefined; + message.points = object.points ?? undefined; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/long_submission.ts b/src/models/domain-layer/legacy/long_submission.ts new file mode 100644 index 0000000..334e561 --- /dev/null +++ b/src/models/domain-layer/legacy/long_submission.ts @@ -0,0 +1,311 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export interface LongSubmission { + longComponentStateId: number; + submissionNumber: number; + submissionText: string; + openTime: number; + submitTime: number; + submissionPoints: number; + languageId: number; + example: boolean; +} + +export interface CreateLongSubmissionInput { + submissionNumber: number; + submissionText: string; + openTime: number; + submitTime: number; + submissionPoints: number; + languageId: number; + example: boolean; +} + +function createBaseLongSubmission(): LongSubmission { + return { + longComponentStateId: 0, + submissionNumber: 0, + submissionText: "", + openTime: 0, + submitTime: 0, + submissionPoints: 0, + languageId: 0, + example: false, + }; +} + +export const LongSubmission = { + encode(message: LongSubmission, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.longComponentStateId !== 0) { + writer.uint32(8).int32(message.longComponentStateId); + } + if (message.submissionNumber !== 0) { + writer.uint32(16).int32(message.submissionNumber); + } + if (message.submissionText !== "") { + writer.uint32(26).string(message.submissionText); + } + if (message.openTime !== 0) { + writer.uint32(32).int64(message.openTime); + } + if (message.submitTime !== 0) { + writer.uint32(40).int64(message.submitTime); + } + if (message.submissionPoints !== 0) { + writer.uint32(48).int32(message.submissionPoints); + } + if (message.languageId !== 0) { + writer.uint32(56).int32(message.languageId); + } + if (message.example === true) { + writer.uint32(64).bool(message.example); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LongSubmission { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLongSubmission(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.longComponentStateId = reader.int32(); + break; + case 2: + message.submissionNumber = reader.int32(); + break; + case 3: + message.submissionText = reader.string(); + break; + case 4: + message.openTime = longToNumber(reader.int64() as Long); + break; + case 5: + message.submitTime = longToNumber(reader.int64() as Long); + break; + case 6: + message.submissionPoints = reader.int32(); + break; + case 7: + message.languageId = reader.int32(); + break; + case 8: + message.example = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LongSubmission { + return { + longComponentStateId: isSet(object.longComponentStateId) ? Number(object.longComponentStateId) : 0, + submissionNumber: isSet(object.submissionNumber) ? Number(object.submissionNumber) : 0, + submissionText: isSet(object.submissionText) ? String(object.submissionText) : "", + openTime: isSet(object.openTime) ? Number(object.openTime) : 0, + submitTime: isSet(object.submitTime) ? Number(object.submitTime) : 0, + submissionPoints: isSet(object.submissionPoints) ? Number(object.submissionPoints) : 0, + languageId: isSet(object.languageId) ? Number(object.languageId) : 0, + example: isSet(object.example) ? Boolean(object.example) : false, + }; + }, + + toJSON(message: LongSubmission): unknown { + const obj: any = {}; + message.longComponentStateId !== undefined && (obj.longComponentStateId = Math.round(message.longComponentStateId)); + message.submissionNumber !== undefined && (obj.submissionNumber = Math.round(message.submissionNumber)); + message.submissionText !== undefined && (obj.submissionText = message.submissionText); + message.openTime !== undefined && (obj.openTime = Math.round(message.openTime)); + message.submitTime !== undefined && (obj.submitTime = Math.round(message.submitTime)); + message.submissionPoints !== undefined && (obj.submissionPoints = Math.round(message.submissionPoints)); + message.languageId !== undefined && (obj.languageId = Math.round(message.languageId)); + message.example !== undefined && (obj.example = message.example); + return obj; + }, + + create, I>>(base?: I): LongSubmission { + return LongSubmission.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): LongSubmission { + const message = createBaseLongSubmission(); + message.longComponentStateId = object.longComponentStateId ?? 0; + message.submissionNumber = object.submissionNumber ?? 0; + message.submissionText = object.submissionText ?? ""; + message.openTime = object.openTime ?? 0; + message.submitTime = object.submitTime ?? 0; + message.submissionPoints = object.submissionPoints ?? 0; + message.languageId = object.languageId ?? 0; + message.example = object.example ?? false; + return message; + }, +}; + +function createBaseCreateLongSubmissionInput(): CreateLongSubmissionInput { + return { + submissionNumber: 0, + submissionText: "", + openTime: 0, + submitTime: 0, + submissionPoints: 0, + languageId: 0, + example: false, + }; +} + +export const CreateLongSubmissionInput = { + encode(message: CreateLongSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.submissionNumber !== 0) { + writer.uint32(8).int32(message.submissionNumber); + } + if (message.submissionText !== "") { + writer.uint32(18).string(message.submissionText); + } + if (message.openTime !== 0) { + writer.uint32(24).int64(message.openTime); + } + if (message.submitTime !== 0) { + writer.uint32(32).int64(message.submitTime); + } + if (message.submissionPoints !== 0) { + writer.uint32(40).int32(message.submissionPoints); + } + if (message.languageId !== 0) { + writer.uint32(48).int32(message.languageId); + } + if (message.example === true) { + writer.uint32(56).bool(message.example); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateLongSubmissionInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateLongSubmissionInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.submissionNumber = reader.int32(); + break; + case 2: + message.submissionText = reader.string(); + break; + case 3: + message.openTime = longToNumber(reader.int64() as Long); + break; + case 4: + message.submitTime = longToNumber(reader.int64() as Long); + break; + case 5: + message.submissionPoints = reader.int32(); + break; + case 6: + message.languageId = reader.int32(); + break; + case 7: + message.example = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateLongSubmissionInput { + return { + submissionNumber: isSet(object.submissionNumber) ? Number(object.submissionNumber) : 0, + submissionText: isSet(object.submissionText) ? String(object.submissionText) : "", + openTime: isSet(object.openTime) ? Number(object.openTime) : 0, + submitTime: isSet(object.submitTime) ? Number(object.submitTime) : 0, + submissionPoints: isSet(object.submissionPoints) ? Number(object.submissionPoints) : 0, + languageId: isSet(object.languageId) ? Number(object.languageId) : 0, + example: isSet(object.example) ? Boolean(object.example) : false, + }; + }, + + toJSON(message: CreateLongSubmissionInput): unknown { + const obj: any = {}; + message.submissionNumber !== undefined && (obj.submissionNumber = Math.round(message.submissionNumber)); + message.submissionText !== undefined && (obj.submissionText = message.submissionText); + message.openTime !== undefined && (obj.openTime = Math.round(message.openTime)); + message.submitTime !== undefined && (obj.submitTime = Math.round(message.submitTime)); + message.submissionPoints !== undefined && (obj.submissionPoints = Math.round(message.submissionPoints)); + message.languageId !== undefined && (obj.languageId = Math.round(message.languageId)); + message.example !== undefined && (obj.example = message.example); + return obj; + }, + + create, I>>(base?: I): CreateLongSubmissionInput { + return CreateLongSubmissionInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateLongSubmissionInput { + const message = createBaseCreateLongSubmissionInput(); + message.submissionNumber = object.submissionNumber ?? 0; + message.submissionText = object.submissionText ?? ""; + message.openTime = object.openTime ?? 0; + message.submitTime = object.submitTime ?? 0; + message.submissionPoints = object.submissionPoints ?? 0; + message.languageId = object.languageId ?? 0; + message.example = object.example ?? false; + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/round_registration.ts b/src/models/domain-layer/legacy/round_registration.ts new file mode 100644 index 0000000..c1e1c03 --- /dev/null +++ b/src/models/domain-layer/legacy/round_registration.ts @@ -0,0 +1,214 @@ +/* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export interface RoundRegistration { + roundId: number; + coderId: number; +} + +export interface CreateRoundRegistrationInput { + roundId: number; + coderId: number; + timestamp: number; + eligible: boolean; + teamId: number; +} + +function createBaseRoundRegistration(): RoundRegistration { + return { roundId: 0, coderId: 0 }; +} + +export const RoundRegistration = { + encode(message: RoundRegistration, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.roundId !== 0) { + writer.uint32(8).int32(message.roundId); + } + if (message.coderId !== 0) { + writer.uint32(16).int32(message.coderId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): RoundRegistration { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseRoundRegistration(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.roundId = reader.int32(); + break; + case 2: + message.coderId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): RoundRegistration { + return { + roundId: isSet(object.roundId) ? Number(object.roundId) : 0, + coderId: isSet(object.coderId) ? Number(object.coderId) : 0, + }; + }, + + toJSON(message: RoundRegistration): unknown { + const obj: any = {}; + message.roundId !== undefined && (obj.roundId = Math.round(message.roundId)); + message.coderId !== undefined && (obj.coderId = Math.round(message.coderId)); + return obj; + }, + + create, I>>(base?: I): RoundRegistration { + return RoundRegistration.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): RoundRegistration { + const message = createBaseRoundRegistration(); + message.roundId = object.roundId ?? 0; + message.coderId = object.coderId ?? 0; + return message; + }, +}; + +function createBaseCreateRoundRegistrationInput(): CreateRoundRegistrationInput { + return { roundId: 0, coderId: 0, timestamp: 0, eligible: false, teamId: 0 }; +} + +export const CreateRoundRegistrationInput = { + encode(message: CreateRoundRegistrationInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.roundId !== 0) { + writer.uint32(8).int32(message.roundId); + } + if (message.coderId !== 0) { + writer.uint32(16).int32(message.coderId); + } + if (message.timestamp !== 0) { + writer.uint32(24).int64(message.timestamp); + } + if (message.eligible === true) { + writer.uint32(32).bool(message.eligible); + } + if (message.teamId !== 0) { + writer.uint32(40).int32(message.teamId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateRoundRegistrationInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateRoundRegistrationInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.roundId = reader.int32(); + break; + case 2: + message.coderId = reader.int32(); + break; + case 3: + message.timestamp = longToNumber(reader.int64() as Long); + break; + case 4: + message.eligible = reader.bool(); + break; + case 5: + message.teamId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateRoundRegistrationInput { + return { + roundId: isSet(object.roundId) ? Number(object.roundId) : 0, + coderId: isSet(object.coderId) ? Number(object.coderId) : 0, + timestamp: isSet(object.timestamp) ? Number(object.timestamp) : 0, + eligible: isSet(object.eligible) ? Boolean(object.eligible) : false, + teamId: isSet(object.teamId) ? Number(object.teamId) : 0, + }; + }, + + toJSON(message: CreateRoundRegistrationInput): unknown { + const obj: any = {}; + message.roundId !== undefined && (obj.roundId = Math.round(message.roundId)); + message.coderId !== undefined && (obj.coderId = Math.round(message.coderId)); + message.timestamp !== undefined && (obj.timestamp = Math.round(message.timestamp)); + message.eligible !== undefined && (obj.eligible = message.eligible); + message.teamId !== undefined && (obj.teamId = Math.round(message.teamId)); + return obj; + }, + + create, I>>(base?: I): CreateRoundRegistrationInput { + return CreateRoundRegistrationInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateRoundRegistrationInput { + const message = createBaseCreateRoundRegistrationInput(); + message.roundId = object.roundId ?? 0; + message.coderId = object.coderId ?? 0; + message.timestamp = object.timestamp ?? 0; + message.eligible = object.eligible ?? false; + message.teamId = object.teamId ?? 0; + return message; + }, +}; + +declare var self: any | undefined; +declare var window: any | undefined; +declare var global: any | undefined; +var tsProtoGlobalThis: any = (() => { + if (typeof globalThis !== "undefined") { + return globalThis; + } + if (typeof self !== "undefined") { + return self; + } + if (typeof window !== "undefined") { + return window; + } + if (typeof global !== "undefined") { + return global; + } + throw "Unable to locate global object"; +})(); + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function longToNumber(long: Long): number { + if (long.gt(Number.MAX_SAFE_INTEGER)) { + throw new tsProtoGlobalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER"); + } + return long.toNumber(); +} + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/models/domain-layer/legacy/services/long_component_state.ts b/src/models/domain-layer/legacy/services/long_component_state.ts new file mode 100644 index 0000000..8118d6d --- /dev/null +++ b/src/models/domain-layer/legacy/services/long_component_state.ts @@ -0,0 +1,57 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CreateResult, LookupCriteria, ScanRequest, ScanResult, UpdateResult } from "@topcoder-framework/lib-common"; +import { + CreateLongComponentStateInput, + LongComponentState, + UpdateLongComponentStateInput, +} from "../long_component_state"; + +export type LegacyLongComponentStateService = typeof LegacyLongComponentStateService; +export const LegacyLongComponentStateService = { + scan: { + path: "/topcoder.domain.service.legacy_long_component_state.LegacyLongComponentState/Scan", + requestStream: false, + responseStream: false, + requestSerialize: (value: ScanRequest) => Buffer.from(ScanRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ScanRequest.decode(value), + responseSerialize: (value: ScanResult) => Buffer.from(ScanResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => ScanResult.decode(value), + }, + lookup: { + path: "/topcoder.domain.service.legacy_long_component_state.LegacyLongComponentState/Lookup", + requestStream: false, + responseStream: false, + requestSerialize: (value: LookupCriteria) => Buffer.from(LookupCriteria.encode(value).finish()), + requestDeserialize: (value: Buffer) => LookupCriteria.decode(value), + responseSerialize: (value: LongComponentState) => Buffer.from(LongComponentState.encode(value).finish()), + responseDeserialize: (value: Buffer) => LongComponentState.decode(value), + }, + create: { + path: "/topcoder.domain.service.legacy_long_component_state.LegacyLongComponentState/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateLongComponentStateInput) => + Buffer.from(CreateLongComponentStateInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateLongComponentStateInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + update: { + path: "/topcoder.domain.service.legacy_long_component_state.LegacyLongComponentState/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateLongComponentStateInput) => + Buffer.from(UpdateLongComponentStateInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateLongComponentStateInput.decode(value), + responseSerialize: (value: UpdateResult) => Buffer.from(UpdateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => UpdateResult.decode(value), + }, +} as const; + +export interface LegacyLongComponentStateServer extends UntypedServiceImplementation { + scan: handleUnaryCall; + lookup: handleUnaryCall; + create: handleUnaryCall; + update: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/long_submission.ts b/src/models/domain-layer/legacy/services/long_submission.ts new file mode 100644 index 0000000..73d7858 --- /dev/null +++ b/src/models/domain-layer/legacy/services/long_submission.ts @@ -0,0 +1,32 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CreateResult, ScanRequest, ScanResult } from "@topcoder-framework/lib-common"; +import { CreateLongSubmissionInput } from "../long_submission"; + +export type LegacyLongSubmissionService = typeof LegacyLongSubmissionService; +export const LegacyLongSubmissionService = { + scan: { + path: "/topcoder.domain.service.legacy_long_submission.LegacyLongSubmission/Scan", + requestStream: false, + responseStream: false, + requestSerialize: (value: ScanRequest) => Buffer.from(ScanRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ScanRequest.decode(value), + responseSerialize: (value: ScanResult) => Buffer.from(ScanResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => ScanResult.decode(value), + }, + create: { + path: "/topcoder.domain.service.legacy_long_submission.LegacyLongSubmission/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateLongSubmissionInput) => + Buffer.from(CreateLongSubmissionInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateLongSubmissionInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, +} as const; + +export interface LegacyLongSubmissionServer extends UntypedServiceImplementation { + scan: handleUnaryCall; + create: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/resource_submission.ts b/src/models/domain-layer/legacy/services/resource_submission.ts new file mode 100644 index 0000000..8a0c87b --- /dev/null +++ b/src/models/domain-layer/legacy/services/resource_submission.ts @@ -0,0 +1,42 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CreateResult, LookupCriteria, ScanRequest, ScanResult } from "@topcoder-framework/lib-common"; +import { CreateResourceSubmissionInput, ResourceSubmission } from "../resource_submission"; + +export type LegacyResourceSubmissionService = typeof LegacyResourceSubmissionService; +export const LegacyResourceSubmissionService = { + scan: { + path: "/topcoder.domain.service.legacy_resource_submission.LegacyResourceSubmission/Scan", + requestStream: false, + responseStream: false, + requestSerialize: (value: ScanRequest) => Buffer.from(ScanRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ScanRequest.decode(value), + responseSerialize: (value: ScanResult) => Buffer.from(ScanResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => ScanResult.decode(value), + }, + lookup: { + path: "/topcoder.domain.service.legacy_resource_submission.LegacyResourceSubmission/Lookup", + requestStream: false, + responseStream: false, + requestSerialize: (value: LookupCriteria) => Buffer.from(LookupCriteria.encode(value).finish()), + requestDeserialize: (value: Buffer) => LookupCriteria.decode(value), + responseSerialize: (value: ResourceSubmission) => Buffer.from(ResourceSubmission.encode(value).finish()), + responseDeserialize: (value: Buffer) => ResourceSubmission.decode(value), + }, + create: { + path: "/topcoder.domain.service.legacy_resource_submission.LegacyResourceSubmission/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateResourceSubmissionInput) => + Buffer.from(CreateResourceSubmissionInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateResourceSubmissionInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, +} as const; + +export interface LegacyResourceSubmissionServer extends UntypedServiceImplementation { + scan: handleUnaryCall; + lookup: handleUnaryCall; + create: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/round_registration.ts b/src/models/domain-layer/legacy/services/round_registration.ts new file mode 100644 index 0000000..780da6c --- /dev/null +++ b/src/models/domain-layer/legacy/services/round_registration.ts @@ -0,0 +1,32 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { CreateResult, ScanRequest, ScanResult } from "@topcoder-framework/lib-common"; +import { CreateRoundRegistrationInput } from "../round_registration"; + +export type LegacyRoundRegistrationService = typeof LegacyRoundRegistrationService; +export const LegacyRoundRegistrationService = { + scan: { + path: "/topcoder.domain.service.legacy_round_registration.LegacyRoundRegistration/Scan", + requestStream: false, + responseStream: false, + requestSerialize: (value: ScanRequest) => Buffer.from(ScanRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ScanRequest.decode(value), + responseSerialize: (value: ScanResult) => Buffer.from(ScanResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => ScanResult.decode(value), + }, + create: { + path: "/topcoder.domain.service.legacy_round_registration.LegacyRoundRegistration/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateRoundRegistrationInput) => + Buffer.from(CreateRoundRegistrationInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateRoundRegistrationInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, +} as const; + +export interface LegacyRoundRegistrationServer extends UntypedServiceImplementation { + scan: handleUnaryCall; + create: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/services/submission.ts b/src/models/domain-layer/legacy/services/submission.ts index 778a78c..b1c1367 100644 --- a/src/models/domain-layer/legacy/services/submission.ts +++ b/src/models/domain-layer/legacy/services/submission.ts @@ -1,36 +1,30 @@ /* eslint-disable */ import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; -import { CheckExistsResult, CreateResult, LookupCriteria, UpdateResult } from "@topcoder-framework/lib-common"; -import { - CreateSubmissionInput, - LegacySubmission, - LegacySubmissionId, - LegacySubmissionList, - UpdateSubmissionInput, -} from "../submission"; +import { CreateResult, LookupCriteria, ScanRequest, ScanResult, UpdateResult } from "@topcoder-framework/lib-common"; +import { CreateSubmissionInput, LegacySubmission, UpdateSubmissionInput } from "../submission"; export type LegacySubmissionService = typeof LegacySubmissionService; export const LegacySubmissionService = { - checkExists: { - path: "/topcoder.domain.service.legacy_submission_service.LegacySubmission/CheckExists", + scan: { + path: "/topcoder.domain.service.legacy_submission.LegacySubmission/Scan", requestStream: false, responseStream: false, - requestSerialize: (value: LegacySubmissionId) => Buffer.from(LegacySubmissionId.encode(value).finish()), - requestDeserialize: (value: Buffer) => LegacySubmissionId.decode(value), - responseSerialize: (value: CheckExistsResult) => Buffer.from(CheckExistsResult.encode(value).finish()), - responseDeserialize: (value: Buffer) => CheckExistsResult.decode(value), + requestSerialize: (value: ScanRequest) => Buffer.from(ScanRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ScanRequest.decode(value), + responseSerialize: (value: ScanResult) => Buffer.from(ScanResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => ScanResult.decode(value), }, lookup: { - path: "/topcoder.domain.service.legacy_submission_service.LegacySubmission/Lookup", + path: "/topcoder.domain.service.legacy_submission.LegacySubmission/Lookup", requestStream: false, responseStream: false, requestSerialize: (value: LookupCriteria) => Buffer.from(LookupCriteria.encode(value).finish()), requestDeserialize: (value: Buffer) => LookupCriteria.decode(value), - responseSerialize: (value: LegacySubmissionList) => Buffer.from(LegacySubmissionList.encode(value).finish()), - responseDeserialize: (value: Buffer) => LegacySubmissionList.decode(value), + responseSerialize: (value: LegacySubmission) => Buffer.from(LegacySubmission.encode(value).finish()), + responseDeserialize: (value: Buffer) => LegacySubmission.decode(value), }, create: { - path: "/topcoder.domain.service.legacy_submission_service.LegacySubmission/Create", + path: "/topcoder.domain.service.legacy_submission.LegacySubmission/Create", requestStream: false, responseStream: false, requestSerialize: (value: CreateSubmissionInput) => Buffer.from(CreateSubmissionInput.encode(value).finish()), @@ -39,7 +33,7 @@ export const LegacySubmissionService = { responseDeserialize: (value: Buffer) => CreateResult.decode(value), }, update: { - path: "/topcoder.domain.service.legacy_submission_service.LegacySubmission/Update", + path: "/topcoder.domain.service.legacy_submission.LegacySubmission/Update", requestStream: false, responseStream: false, requestSerialize: (value: UpdateSubmissionInput) => Buffer.from(UpdateSubmissionInput.encode(value).finish()), @@ -47,21 +41,11 @@ export const LegacySubmissionService = { responseSerialize: (value: UpdateResult) => Buffer.from(UpdateResult.encode(value).finish()), responseDeserialize: (value: Buffer) => UpdateResult.decode(value), }, - get: { - path: "/topcoder.domain.service.legacy_submission_service.LegacySubmission/Get", - requestStream: false, - responseStream: false, - requestSerialize: (value: LegacySubmissionId) => Buffer.from(LegacySubmissionId.encode(value).finish()), - requestDeserialize: (value: Buffer) => LegacySubmissionId.decode(value), - responseSerialize: (value: LegacySubmission) => Buffer.from(LegacySubmission.encode(value).finish()), - responseDeserialize: (value: Buffer) => LegacySubmission.decode(value), - }, } as const; export interface LegacySubmissionServer extends UntypedServiceImplementation { - checkExists: handleUnaryCall; - lookup: handleUnaryCall; + scan: handleUnaryCall; + lookup: handleUnaryCall; create: handleUnaryCall; update: handleUnaryCall; - get: handleUnaryCall; } diff --git a/src/models/domain-layer/legacy/services/upload.ts b/src/models/domain-layer/legacy/services/upload.ts new file mode 100644 index 0000000..ffc6a31 --- /dev/null +++ b/src/models/domain-layer/legacy/services/upload.ts @@ -0,0 +1,68 @@ +/* eslint-disable */ +import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; +import { + CreateResult, + Empty, + LookupCriteria, + ScanRequest, + ScanResult, + UpdateResult, +} from "@topcoder-framework/lib-common"; +import { CreateUploadInput, UpdateUploadInput, Upload } from "../upload"; + +export type LegacyUploadService = typeof LegacyUploadService; +export const LegacyUploadService = { + scan: { + path: "/topcoder.domain.service.legacy_upload.LegacyUpload/Scan", + requestStream: false, + responseStream: false, + requestSerialize: (value: ScanRequest) => Buffer.from(ScanRequest.encode(value).finish()), + requestDeserialize: (value: Buffer) => ScanRequest.decode(value), + responseSerialize: (value: ScanResult) => Buffer.from(ScanResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => ScanResult.decode(value), + }, + lookup: { + path: "/topcoder.domain.service.legacy_upload.LegacyUpload/Lookup", + requestStream: false, + responseStream: false, + requestSerialize: (value: LookupCriteria) => Buffer.from(LookupCriteria.encode(value).finish()), + requestDeserialize: (value: Buffer) => LookupCriteria.decode(value), + responseSerialize: (value: Upload) => Buffer.from(Upload.encode(value).finish()), + responseDeserialize: (value: Buffer) => Upload.decode(value), + }, + create: { + path: "/topcoder.domain.service.legacy_upload.LegacyUpload/Create", + requestStream: false, + responseStream: false, + requestSerialize: (value: CreateUploadInput) => Buffer.from(CreateUploadInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => CreateUploadInput.decode(value), + responseSerialize: (value: CreateResult) => Buffer.from(CreateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CreateResult.decode(value), + }, + update: { + path: "/topcoder.domain.service.legacy_upload.LegacyUpload/Update", + requestStream: false, + responseStream: false, + requestSerialize: (value: UpdateUploadInput) => Buffer.from(UpdateUploadInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => UpdateUploadInput.decode(value), + responseSerialize: (value: UpdateResult) => Buffer.from(UpdateResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => UpdateResult.decode(value), + }, + delete: { + path: "/topcoder.domain.service.legacy_upload.LegacyUpload/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: LookupCriteria) => Buffer.from(LookupCriteria.encode(value).finish()), + requestDeserialize: (value: Buffer) => LookupCriteria.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, +} as const; + +export interface LegacyUploadServer extends UntypedServiceImplementation { + scan: handleUnaryCall; + lookup: handleUnaryCall; + create: handleUnaryCall; + update: handleUnaryCall; + delete: handleUnaryCall; +} diff --git a/src/models/domain-layer/legacy/submission.ts b/src/models/domain-layer/legacy/submission.ts index 1f69d50..2029b39 100644 --- a/src/models/domain-layer/legacy/submission.ts +++ b/src/models/domain-layer/legacy/submission.ts @@ -7,39 +7,42 @@ export interface LegacySubmission { submissionStatusId: number; submissionTypeId: number; uploadId: number; + screeningScore: number; + initialScore: number; + finalScore: number; createUser: number; createDate: number; modifyUser: number; modifyDate: number; } -export interface LegacySubmissionId { - submissionId: number; -} - -export interface LegacySubmissionList { - legacySubmissions: LegacySubmission[]; -} - export interface CreateSubmissionInput { submissionStatusId: number; submissionTypeId: number; uploadId: number; - createUser: number; - createDate: number; - modifyUser: number; - modifyDate: number; + challengeId: string; + created: number; + fileType: string; + legacyChallengeId?: number | undefined; + memberId: number; + submissionPhaseId: string; + submittedDate?: number | undefined; + type: string; + updated?: number | undefined; + updatedBy?: string | undefined; + url?: string | undefined; + legacyUploadId?: number | undefined; + v5ChallengeId?: string | undefined; } export interface UpdateSubmissionInput { submissionId: number; - submissionStatusId: number; - submissionTypeId: number; - uploadId: number; - createUser: number; - createDate: number; - modifyUser: number; - modifyDate: number; + submissionStatusId?: number | undefined; + submissionTypeId?: number | undefined; + uploadId?: number | undefined; + screeningScore?: number | undefined; + initialScore?: number | undefined; + finalScore?: number | undefined; } function createBaseLegacySubmission(): LegacySubmission { @@ -48,6 +51,9 @@ function createBaseLegacySubmission(): LegacySubmission { submissionStatusId: 0, submissionTypeId: 0, uploadId: 0, + screeningScore: 0, + initialScore: 0, + finalScore: 0, createUser: 0, createDate: 0, modifyUser: 0, @@ -69,17 +75,26 @@ export const LegacySubmission = { if (message.uploadId !== 0) { writer.uint32(32).int32(message.uploadId); } + if (message.screeningScore !== 0) { + writer.uint32(40).int32(message.screeningScore); + } + if (message.initialScore !== 0) { + writer.uint32(48).int32(message.initialScore); + } + if (message.finalScore !== 0) { + writer.uint32(56).int32(message.finalScore); + } if (message.createUser !== 0) { - writer.uint32(40).int32(message.createUser); + writer.uint32(64).int32(message.createUser); } if (message.createDate !== 0) { - writer.uint32(48).int64(message.createDate); + writer.uint32(72).int64(message.createDate); } if (message.modifyUser !== 0) { - writer.uint32(56).int32(message.modifyUser); + writer.uint32(80).int32(message.modifyUser); } if (message.modifyDate !== 0) { - writer.uint32(64).int64(message.modifyDate); + writer.uint32(88).int64(message.modifyDate); } return writer; }, @@ -104,15 +119,24 @@ export const LegacySubmission = { message.uploadId = reader.int32(); break; case 5: - message.createUser = reader.int32(); + message.screeningScore = reader.int32(); break; case 6: - message.createDate = longToNumber(reader.int64() as Long); + message.initialScore = reader.int32(); break; case 7: - message.modifyUser = reader.int32(); + message.finalScore = reader.int32(); break; case 8: + message.createUser = reader.int32(); + break; + case 9: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 10: + message.modifyUser = reader.int32(); + break; + case 11: message.modifyDate = longToNumber(reader.int64() as Long); break; default: @@ -129,6 +153,9 @@ export const LegacySubmission = { submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + screeningScore: isSet(object.screeningScore) ? Number(object.screeningScore) : 0, + initialScore: isSet(object.initialScore) ? Number(object.initialScore) : 0, + finalScore: isSet(object.finalScore) ? Number(object.finalScore) : 0, createUser: isSet(object.createUser) ? Number(object.createUser) : 0, createDate: isSet(object.createDate) ? Number(object.createDate) : 0, modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, @@ -142,6 +169,9 @@ export const LegacySubmission = { message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.screeningScore !== undefined && (obj.screeningScore = Math.round(message.screeningScore)); + message.initialScore !== undefined && (obj.initialScore = Math.round(message.initialScore)); + message.finalScore !== undefined && (obj.finalScore = Math.round(message.finalScore)); message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); @@ -159,6 +189,9 @@ export const LegacySubmission = { message.submissionStatusId = object.submissionStatusId ?? 0; message.submissionTypeId = object.submissionTypeId ?? 0; message.uploadId = object.uploadId ?? 0; + message.screeningScore = object.screeningScore ?? 0; + message.initialScore = object.initialScore ?? 0; + message.finalScore = object.finalScore ?? 0; message.createUser = object.createUser ?? 0; message.createDate = object.createDate ?? 0; message.modifyUser = object.modifyUser ?? 0; @@ -167,125 +200,24 @@ export const LegacySubmission = { }, }; -function createBaseLegacySubmissionId(): LegacySubmissionId { - return { submissionId: 0 }; -} - -export const LegacySubmissionId = { - encode(message: LegacySubmissionId, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.submissionId !== 0) { - writer.uint32(8).int32(message.submissionId); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): LegacySubmissionId { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLegacySubmissionId(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.submissionId = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LegacySubmissionId { - return { submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0 }; - }, - - toJSON(message: LegacySubmissionId): unknown { - const obj: any = {}; - message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); - return obj; - }, - - create, I>>(base?: I): LegacySubmissionId { - return LegacySubmissionId.fromPartial(base ?? {}); - }, - - fromPartial, I>>(object: I): LegacySubmissionId { - const message = createBaseLegacySubmissionId(); - message.submissionId = object.submissionId ?? 0; - return message; - }, -}; - -function createBaseLegacySubmissionList(): LegacySubmissionList { - return { legacySubmissions: [] }; -} - -export const LegacySubmissionList = { - encode(message: LegacySubmissionList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.legacySubmissions) { - LegacySubmission.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): LegacySubmissionList { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseLegacySubmissionList(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.legacySubmissions.push(LegacySubmission.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): LegacySubmissionList { - return { - legacySubmissions: Array.isArray(object?.legacySubmissions) - ? object.legacySubmissions.map((e: any) => LegacySubmission.fromJSON(e)) - : [], - }; - }, - - toJSON(message: LegacySubmissionList): unknown { - const obj: any = {}; - if (message.legacySubmissions) { - obj.legacySubmissions = message.legacySubmissions.map((e) => e ? LegacySubmission.toJSON(e) : undefined); - } else { - obj.legacySubmissions = []; - } - return obj; - }, - - create, I>>(base?: I): LegacySubmissionList { - return LegacySubmissionList.fromPartial(base ?? {}); - }, - - fromPartial, I>>(object: I): LegacySubmissionList { - const message = createBaseLegacySubmissionList(); - message.legacySubmissions = object.legacySubmissions?.map((e) => LegacySubmission.fromPartial(e)) || []; - return message; - }, -}; - function createBaseCreateSubmissionInput(): CreateSubmissionInput { return { submissionStatusId: 0, submissionTypeId: 0, uploadId: 0, - createUser: 0, - createDate: 0, - modifyUser: 0, - modifyDate: 0, + challengeId: "", + created: 0, + fileType: "", + legacyChallengeId: undefined, + memberId: 0, + submissionPhaseId: "", + submittedDate: undefined, + type: "", + updated: undefined, + updatedBy: undefined, + url: undefined, + legacyUploadId: undefined, + v5ChallengeId: undefined, }; } @@ -300,17 +232,44 @@ export const CreateSubmissionInput = { if (message.uploadId !== 0) { writer.uint32(24).int32(message.uploadId); } - if (message.createUser !== 0) { - writer.uint32(32).int32(message.createUser); + if (message.challengeId !== "") { + writer.uint32(34).string(message.challengeId); } - if (message.createDate !== 0) { - writer.uint32(40).int64(message.createDate); + if (message.created !== 0) { + writer.uint32(40).int64(message.created); } - if (message.modifyUser !== 0) { - writer.uint32(48).int32(message.modifyUser); + if (message.fileType !== "") { + writer.uint32(50).string(message.fileType); } - if (message.modifyDate !== 0) { - writer.uint32(56).int64(message.modifyDate); + if (message.legacyChallengeId !== undefined) { + writer.uint32(56).int64(message.legacyChallengeId); + } + if (message.memberId !== 0) { + writer.uint32(64).int64(message.memberId); + } + if (message.submissionPhaseId !== "") { + writer.uint32(74).string(message.submissionPhaseId); + } + if (message.submittedDate !== undefined) { + writer.uint32(80).int64(message.submittedDate); + } + if (message.type !== "") { + writer.uint32(90).string(message.type); + } + if (message.updated !== undefined) { + writer.uint32(96).int64(message.updated); + } + if (message.updatedBy !== undefined) { + writer.uint32(106).string(message.updatedBy); + } + if (message.url !== undefined) { + writer.uint32(114).string(message.url); + } + if (message.legacyUploadId !== undefined) { + writer.uint32(120).int64(message.legacyUploadId); + } + if (message.v5ChallengeId !== undefined) { + writer.uint32(130).string(message.v5ChallengeId); } return writer; }, @@ -332,16 +291,43 @@ export const CreateSubmissionInput = { message.uploadId = reader.int32(); break; case 4: - message.createUser = reader.int32(); + message.challengeId = reader.string(); break; case 5: - message.createDate = longToNumber(reader.int64() as Long); + message.created = longToNumber(reader.int64() as Long); break; case 6: - message.modifyUser = reader.int32(); + message.fileType = reader.string(); break; case 7: - message.modifyDate = longToNumber(reader.int64() as Long); + message.legacyChallengeId = longToNumber(reader.int64() as Long); + break; + case 8: + message.memberId = longToNumber(reader.int64() as Long); + break; + case 9: + message.submissionPhaseId = reader.string(); + break; + case 10: + message.submittedDate = longToNumber(reader.int64() as Long); + break; + case 11: + message.type = reader.string(); + break; + case 12: + message.updated = longToNumber(reader.int64() as Long); + break; + case 13: + message.updatedBy = reader.string(); + break; + case 14: + message.url = reader.string(); + break; + case 15: + message.legacyUploadId = longToNumber(reader.int64() as Long); + break; + case 16: + message.v5ChallengeId = reader.string(); break; default: reader.skipType(tag & 7); @@ -356,10 +342,19 @@ export const CreateSubmissionInput = { submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, - createUser: isSet(object.createUser) ? Number(object.createUser) : 0, - createDate: isSet(object.createDate) ? Number(object.createDate) : 0, - modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, - modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + challengeId: isSet(object.challengeId) ? String(object.challengeId) : "", + created: isSet(object.created) ? Number(object.created) : 0, + fileType: isSet(object.fileType) ? String(object.fileType) : "", + legacyChallengeId: isSet(object.legacyChallengeId) ? Number(object.legacyChallengeId) : undefined, + memberId: isSet(object.memberId) ? Number(object.memberId) : 0, + submissionPhaseId: isSet(object.submissionPhaseId) ? String(object.submissionPhaseId) : "", + submittedDate: isSet(object.submittedDate) ? Number(object.submittedDate) : undefined, + type: isSet(object.type) ? String(object.type) : "", + updated: isSet(object.updated) ? Number(object.updated) : undefined, + updatedBy: isSet(object.updatedBy) ? String(object.updatedBy) : undefined, + url: isSet(object.url) ? String(object.url) : undefined, + legacyUploadId: isSet(object.legacyUploadId) ? Number(object.legacyUploadId) : undefined, + v5ChallengeId: isSet(object.v5ChallengeId) ? String(object.v5ChallengeId) : undefined, }; }, @@ -368,10 +363,19 @@ export const CreateSubmissionInput = { message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); - message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); - message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); - message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); - message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + message.challengeId !== undefined && (obj.challengeId = message.challengeId); + message.created !== undefined && (obj.created = Math.round(message.created)); + message.fileType !== undefined && (obj.fileType = message.fileType); + message.legacyChallengeId !== undefined && (obj.legacyChallengeId = Math.round(message.legacyChallengeId)); + message.memberId !== undefined && (obj.memberId = Math.round(message.memberId)); + message.submissionPhaseId !== undefined && (obj.submissionPhaseId = message.submissionPhaseId); + message.submittedDate !== undefined && (obj.submittedDate = Math.round(message.submittedDate)); + message.type !== undefined && (obj.type = message.type); + message.updated !== undefined && (obj.updated = Math.round(message.updated)); + message.updatedBy !== undefined && (obj.updatedBy = message.updatedBy); + message.url !== undefined && (obj.url = message.url); + message.legacyUploadId !== undefined && (obj.legacyUploadId = Math.round(message.legacyUploadId)); + message.v5ChallengeId !== undefined && (obj.v5ChallengeId = message.v5ChallengeId); return obj; }, @@ -384,10 +388,19 @@ export const CreateSubmissionInput = { message.submissionStatusId = object.submissionStatusId ?? 0; message.submissionTypeId = object.submissionTypeId ?? 0; message.uploadId = object.uploadId ?? 0; - message.createUser = object.createUser ?? 0; - message.createDate = object.createDate ?? 0; - message.modifyUser = object.modifyUser ?? 0; - message.modifyDate = object.modifyDate ?? 0; + message.challengeId = object.challengeId ?? ""; + message.created = object.created ?? 0; + message.fileType = object.fileType ?? ""; + message.legacyChallengeId = object.legacyChallengeId ?? undefined; + message.memberId = object.memberId ?? 0; + message.submissionPhaseId = object.submissionPhaseId ?? ""; + message.submittedDate = object.submittedDate ?? undefined; + message.type = object.type ?? ""; + message.updated = object.updated ?? undefined; + message.updatedBy = object.updatedBy ?? undefined; + message.url = object.url ?? undefined; + message.legacyUploadId = object.legacyUploadId ?? undefined; + message.v5ChallengeId = object.v5ChallengeId ?? undefined; return message; }, }; @@ -395,13 +408,12 @@ export const CreateSubmissionInput = { function createBaseUpdateSubmissionInput(): UpdateSubmissionInput { return { submissionId: 0, - submissionStatusId: 0, - submissionTypeId: 0, - uploadId: 0, - createUser: 0, - createDate: 0, - modifyUser: 0, - modifyDate: 0, + submissionStatusId: undefined, + submissionTypeId: undefined, + uploadId: undefined, + screeningScore: undefined, + initialScore: undefined, + finalScore: undefined, }; } @@ -410,26 +422,23 @@ export const UpdateSubmissionInput = { if (message.submissionId !== 0) { writer.uint32(8).int32(message.submissionId); } - if (message.submissionStatusId !== 0) { + if (message.submissionStatusId !== undefined) { writer.uint32(16).int32(message.submissionStatusId); } - if (message.submissionTypeId !== 0) { + if (message.submissionTypeId !== undefined) { writer.uint32(24).int32(message.submissionTypeId); } - if (message.uploadId !== 0) { + if (message.uploadId !== undefined) { writer.uint32(32).int32(message.uploadId); } - if (message.createUser !== 0) { - writer.uint32(40).int32(message.createUser); + if (message.screeningScore !== undefined) { + writer.uint32(40).int32(message.screeningScore); } - if (message.createDate !== 0) { - writer.uint32(48).int64(message.createDate); + if (message.initialScore !== undefined) { + writer.uint32(48).int32(message.initialScore); } - if (message.modifyUser !== 0) { - writer.uint32(56).int32(message.modifyUser); - } - if (message.modifyDate !== 0) { - writer.uint32(64).int64(message.modifyDate); + if (message.finalScore !== undefined) { + writer.uint32(56).int32(message.finalScore); } return writer; }, @@ -454,16 +463,13 @@ export const UpdateSubmissionInput = { message.uploadId = reader.int32(); break; case 5: - message.createUser = reader.int32(); + message.screeningScore = reader.int32(); break; case 6: - message.createDate = longToNumber(reader.int64() as Long); + message.initialScore = reader.int32(); break; case 7: - message.modifyUser = reader.int32(); - break; - case 8: - message.modifyDate = longToNumber(reader.int64() as Long); + message.finalScore = reader.int32(); break; default: reader.skipType(tag & 7); @@ -476,13 +482,12 @@ export const UpdateSubmissionInput = { fromJSON(object: any): UpdateSubmissionInput { return { submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, - submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, - submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, - uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, - createUser: isSet(object.createUser) ? Number(object.createUser) : 0, - createDate: isSet(object.createDate) ? Number(object.createDate) : 0, - modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, - modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : undefined, + submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : undefined, + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : undefined, + screeningScore: isSet(object.screeningScore) ? Number(object.screeningScore) : undefined, + initialScore: isSet(object.initialScore) ? Number(object.initialScore) : undefined, + finalScore: isSet(object.finalScore) ? Number(object.finalScore) : undefined, }; }, @@ -492,10 +497,9 @@ export const UpdateSubmissionInput = { message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); - message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); - message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); - message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); - message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + message.screeningScore !== undefined && (obj.screeningScore = Math.round(message.screeningScore)); + message.initialScore !== undefined && (obj.initialScore = Math.round(message.initialScore)); + message.finalScore !== undefined && (obj.finalScore = Math.round(message.finalScore)); return obj; }, @@ -506,13 +510,12 @@ export const UpdateSubmissionInput = { fromPartial, I>>(object: I): UpdateSubmissionInput { const message = createBaseUpdateSubmissionInput(); message.submissionId = object.submissionId ?? 0; - message.submissionStatusId = object.submissionStatusId ?? 0; - message.submissionTypeId = object.submissionTypeId ?? 0; - message.uploadId = object.uploadId ?? 0; - message.createUser = object.createUser ?? 0; - message.createDate = object.createDate ?? 0; - message.modifyUser = object.modifyUser ?? 0; - message.modifyDate = object.modifyDate ?? 0; + message.submissionStatusId = object.submissionStatusId ?? undefined; + message.submissionTypeId = object.submissionTypeId ?? undefined; + message.uploadId = object.uploadId ?? undefined; + message.screeningScore = object.screeningScore ?? undefined; + message.initialScore = object.initialScore ?? undefined; + message.finalScore = object.finalScore ?? undefined; return message; }, }; diff --git a/src/models/domain-layer/legacy/upload.ts b/src/models/domain-layer/legacy/upload.ts new file mode 100644 index 0000000..ab07695 --- /dev/null +++ b/src/models/domain-layer/legacy/upload.ts @@ -0,0 +1,570 @@ +/* eslint-disable */ +import { ScanCriteria } from "@topcoder-framework/lib-common"; +import _m0 from "protobufjs/minimal"; + +export interface Upload { + uploadId: number; + projectId: number; + resourceId: number; + projectPhaseId: number; + uploadTypeId: number; + url: string; + uploadStatusId: number; + parameter: string; + createUser: number; + modifyUser: number; + createDate: number; + modifyDate: number; +} + +export interface UploadId { + uploadId: number; +} + +export interface UploadList { + uploads: Upload[]; +} + +export interface CreateUploadInput { + projectId: number; + resourceId: number; + projectPhaseId: number; + uploadTypeId: number; + url: string; + uploadStatusId: number; + parameter: string; +} + +export interface UpdateUploadInput { + uploadId: number; + url?: string | undefined; + uploadStatusId?: number | undefined; +} + +export interface DeleteUploadInput { + filterCriteria: ScanCriteria[]; +} + +function createBaseUpload(): Upload { + return { + uploadId: 0, + projectId: 0, + resourceId: 0, + projectPhaseId: 0, + uploadTypeId: 0, + url: "", + uploadStatusId: 0, + parameter: "", + createUser: 0, + modifyUser: 0, + createDate: 0, + modifyDate: 0, + }; +} + +export const Upload = { + encode(message: Upload, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.uploadId !== 0) { + writer.uint32(8).int32(message.uploadId); + } + if (message.projectId !== 0) { + writer.uint32(16).int32(message.projectId); + } + if (message.resourceId !== 0) { + writer.uint32(24).int32(message.resourceId); + } + if (message.projectPhaseId !== 0) { + writer.uint32(32).int32(message.projectPhaseId); + } + if (message.uploadTypeId !== 0) { + writer.uint32(40).int32(message.uploadTypeId); + } + if (message.url !== "") { + writer.uint32(50).string(message.url); + } + if (message.uploadStatusId !== 0) { + writer.uint32(56).int32(message.uploadStatusId); + } + if (message.parameter !== "") { + writer.uint32(66).string(message.parameter); + } + if (message.createUser !== 0) { + writer.uint32(72).int32(message.createUser); + } + if (message.modifyUser !== 0) { + writer.uint32(80).int32(message.modifyUser); + } + if (message.createDate !== 0) { + writer.uint32(88).int32(message.createDate); + } + if (message.modifyDate !== 0) { + writer.uint32(96).int32(message.modifyDate); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): Upload { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpload(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uploadId = reader.int32(); + break; + case 2: + message.projectId = reader.int32(); + break; + case 3: + message.resourceId = reader.int32(); + break; + case 4: + message.projectPhaseId = reader.int32(); + break; + case 5: + message.uploadTypeId = reader.int32(); + break; + case 6: + message.url = reader.string(); + break; + case 7: + message.uploadStatusId = reader.int32(); + break; + case 8: + message.parameter = reader.string(); + break; + case 9: + message.createUser = reader.int32(); + break; + case 10: + message.modifyUser = reader.int32(); + break; + case 11: + message.createDate = reader.int32(); + break; + case 12: + message.modifyDate = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): Upload { + return { + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + uploadTypeId: isSet(object.uploadTypeId) ? Number(object.uploadTypeId) : 0, + url: isSet(object.url) ? String(object.url) : "", + uploadStatusId: isSet(object.uploadStatusId) ? Number(object.uploadStatusId) : 0, + parameter: isSet(object.parameter) ? String(object.parameter) : "", + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + createDate: isSet(object.createDate) ? Number(object.createDate) : 0, + modifyDate: isSet(object.modifyDate) ? Number(object.modifyDate) : 0, + }; + }, + + toJSON(message: Upload): unknown { + const obj: any = {}; + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.uploadTypeId !== undefined && (obj.uploadTypeId = Math.round(message.uploadTypeId)); + message.url !== undefined && (obj.url = message.url); + message.uploadStatusId !== undefined && (obj.uploadStatusId = Math.round(message.uploadStatusId)); + message.parameter !== undefined && (obj.parameter = message.parameter); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); + message.modifyDate !== undefined && (obj.modifyDate = Math.round(message.modifyDate)); + return obj; + }, + + create, I>>(base?: I): Upload { + return Upload.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): Upload { + const message = createBaseUpload(); + message.uploadId = object.uploadId ?? 0; + message.projectId = object.projectId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.projectPhaseId = object.projectPhaseId ?? 0; + message.uploadTypeId = object.uploadTypeId ?? 0; + message.url = object.url ?? ""; + message.uploadStatusId = object.uploadStatusId ?? 0; + message.parameter = object.parameter ?? ""; + message.createUser = object.createUser ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.createDate = object.createDate ?? 0; + message.modifyDate = object.modifyDate ?? 0; + return message; + }, +}; + +function createBaseUploadId(): UploadId { + return { uploadId: 0 }; +} + +export const UploadId = { + encode(message: UploadId, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.uploadId !== 0) { + writer.uint32(8).int32(message.uploadId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UploadId { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uploadId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UploadId { + return { uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0 }; + }, + + toJSON(message: UploadId): unknown { + const obj: any = {}; + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + return obj; + }, + + create, I>>(base?: I): UploadId { + return UploadId.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UploadId { + const message = createBaseUploadId(); + message.uploadId = object.uploadId ?? 0; + return message; + }, +}; + +function createBaseUploadList(): UploadList { + return { uploads: [] }; +} + +export const UploadList = { + encode(message: UploadList, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.uploads) { + Upload.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UploadList { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUploadList(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uploads.push(Upload.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UploadList { + return { uploads: Array.isArray(object?.uploads) ? object.uploads.map((e: any) => Upload.fromJSON(e)) : [] }; + }, + + toJSON(message: UploadList): unknown { + const obj: any = {}; + if (message.uploads) { + obj.uploads = message.uploads.map((e) => e ? Upload.toJSON(e) : undefined); + } else { + obj.uploads = []; + } + return obj; + }, + + create, I>>(base?: I): UploadList { + return UploadList.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UploadList { + const message = createBaseUploadList(); + message.uploads = object.uploads?.map((e) => Upload.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseCreateUploadInput(): CreateUploadInput { + return { projectId: 0, resourceId: 0, projectPhaseId: 0, uploadTypeId: 0, url: "", uploadStatusId: 0, parameter: "" }; +} + +export const CreateUploadInput = { + encode(message: CreateUploadInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.projectId !== 0) { + writer.uint32(8).int32(message.projectId); + } + if (message.resourceId !== 0) { + writer.uint32(16).int32(message.resourceId); + } + if (message.projectPhaseId !== 0) { + writer.uint32(24).int32(message.projectPhaseId); + } + if (message.uploadTypeId !== 0) { + writer.uint32(32).int32(message.uploadTypeId); + } + if (message.url !== "") { + writer.uint32(42).string(message.url); + } + if (message.uploadStatusId !== 0) { + writer.uint32(48).int32(message.uploadStatusId); + } + if (message.parameter !== "") { + writer.uint32(58).string(message.parameter); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): CreateUploadInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseCreateUploadInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.projectId = reader.int32(); + break; + case 2: + message.resourceId = reader.int32(); + break; + case 3: + message.projectPhaseId = reader.int32(); + break; + case 4: + message.uploadTypeId = reader.int32(); + break; + case 5: + message.url = reader.string(); + break; + case 6: + message.uploadStatusId = reader.int32(); + break; + case 7: + message.parameter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): CreateUploadInput { + return { + projectId: isSet(object.projectId) ? Number(object.projectId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + projectPhaseId: isSet(object.projectPhaseId) ? Number(object.projectPhaseId) : 0, + uploadTypeId: isSet(object.uploadTypeId) ? Number(object.uploadTypeId) : 0, + url: isSet(object.url) ? String(object.url) : "", + uploadStatusId: isSet(object.uploadStatusId) ? Number(object.uploadStatusId) : 0, + parameter: isSet(object.parameter) ? String(object.parameter) : "", + }; + }, + + toJSON(message: CreateUploadInput): unknown { + const obj: any = {}; + message.projectId !== undefined && (obj.projectId = Math.round(message.projectId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.projectPhaseId !== undefined && (obj.projectPhaseId = Math.round(message.projectPhaseId)); + message.uploadTypeId !== undefined && (obj.uploadTypeId = Math.round(message.uploadTypeId)); + message.url !== undefined && (obj.url = message.url); + message.uploadStatusId !== undefined && (obj.uploadStatusId = Math.round(message.uploadStatusId)); + message.parameter !== undefined && (obj.parameter = message.parameter); + return obj; + }, + + create, I>>(base?: I): CreateUploadInput { + return CreateUploadInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): CreateUploadInput { + const message = createBaseCreateUploadInput(); + message.projectId = object.projectId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.projectPhaseId = object.projectPhaseId ?? 0; + message.uploadTypeId = object.uploadTypeId ?? 0; + message.url = object.url ?? ""; + message.uploadStatusId = object.uploadStatusId ?? 0; + message.parameter = object.parameter ?? ""; + return message; + }, +}; + +function createBaseUpdateUploadInput(): UpdateUploadInput { + return { uploadId: 0, url: undefined, uploadStatusId: undefined }; +} + +export const UpdateUploadInput = { + encode(message: UpdateUploadInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.uploadId !== 0) { + writer.uint32(8).int32(message.uploadId); + } + if (message.url !== undefined) { + writer.uint32(18).string(message.url); + } + if (message.uploadStatusId !== undefined) { + writer.uint32(24).int32(message.uploadStatusId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUploadInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUpdateUploadInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uploadId = reader.int32(); + break; + case 2: + message.url = reader.string(); + break; + case 3: + message.uploadStatusId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UpdateUploadInput { + return { + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + url: isSet(object.url) ? String(object.url) : undefined, + uploadStatusId: isSet(object.uploadStatusId) ? Number(object.uploadStatusId) : undefined, + }; + }, + + toJSON(message: UpdateUploadInput): unknown { + const obj: any = {}; + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.url !== undefined && (obj.url = message.url); + message.uploadStatusId !== undefined && (obj.uploadStatusId = Math.round(message.uploadStatusId)); + return obj; + }, + + create, I>>(base?: I): UpdateUploadInput { + return UpdateUploadInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): UpdateUploadInput { + const message = createBaseUpdateUploadInput(); + message.uploadId = object.uploadId ?? 0; + message.url = object.url ?? undefined; + message.uploadStatusId = object.uploadStatusId ?? undefined; + return message; + }, +}; + +function createBaseDeleteUploadInput(): DeleteUploadInput { + return { filterCriteria: [] }; +} + +export const DeleteUploadInput = { + encode(message: DeleteUploadInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.filterCriteria) { + ScanCriteria.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteUploadInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteUploadInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.filterCriteria.push(ScanCriteria.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteUploadInput { + return { + filterCriteria: Array.isArray(object?.filterCriteria) + ? object.filterCriteria.map((e: any) => ScanCriteria.fromJSON(e)) + : [], + }; + }, + + toJSON(message: DeleteUploadInput): unknown { + const obj: any = {}; + if (message.filterCriteria) { + obj.filterCriteria = message.filterCriteria.map((e) => e ? ScanCriteria.toJSON(e) : undefined); + } else { + obj.filterCriteria = []; + } + return obj; + }, + + create, I>>(base?: I): DeleteUploadInput { + return DeleteUploadInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeleteUploadInput { + const message = createBaseDeleteUploadInput(); + message.filterCriteria = object.filterCriteria?.map((e) => ScanCriteria.fromPartial(e)) || []; + return message; + }, +}; + +type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; + +type DeepPartial = T extends Builtin ? T + : T extends Array ? Array> : T extends ReadonlyArray ? ReadonlyArray> + : T extends { $case: string } ? { [K in keyof Omit]?: DeepPartial } & { $case: T["$case"] } + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +type Exact = P extends Builtin ? P + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + +function isSet(value: any): boolean { + return value !== null && value !== undefined; +} diff --git a/src/schema/submission/Submission.ts b/src/schema/submission/Submission.ts new file mode 100644 index 0000000..cbcbf70 --- /dev/null +++ b/src/schema/submission/Submission.ts @@ -0,0 +1,21 @@ +import { ColumnType, Schema } from "@topcoder-framework/client-relational"; +import { LegacySubmission } from "../../models/domain-layer/legacy/submission"; +import { AuditColumns } from "../common/AuditColumns"; + +export const LegacySubmissionSchema: Schema = { + dbSchema: "tcs_catalog", + tableName: "submission", + idColumn: "submission_id", + idSequence: "submission_id_seq", + idTable: "submission", + columns: { + submissionId: { name: "submission_id", type: ColumnType.COLUMN_TYPE_INT }, + submissionStatusId: { name: "submission_status_id", type: ColumnType.COLUMN_TYPE_INT }, + submissionTypeId: { name: "submission_type_id", type: ColumnType.COLUMN_TYPE_INT }, + uploadId: { name: "upload_id", type: ColumnType.COLUMN_TYPE_INT }, + screeningScore: { name: "screening_score", type: ColumnType.COLUMN_TYPE_INT }, + initialScore: { name: "initial_score", type: ColumnType.COLUMN_TYPE_INT }, + finalScore: { name: "final_score", type: ColumnType.COLUMN_TYPE_INT }, + ...AuditColumns, + }, +}; diff --git a/src/schema/submission/Upload.ts b/src/schema/submission/Upload.ts new file mode 100644 index 0000000..1fbe487 --- /dev/null +++ b/src/schema/submission/Upload.ts @@ -0,0 +1,22 @@ +import { ColumnType, Schema } from "@topcoder-framework/client-relational"; +import { Upload } from "../../models/domain-layer/legacy/upload"; +import { AuditColumns } from "../common/AuditColumns"; + +export const UploadSchema: Schema = { + dbSchema: "tcs_catalog", + tableName: "upload", + idColumn: "upload_id", + idSequence: "upload_id_seq", + idTable: "upload", + columns: { + uploadId: { name: "upload_id", type: ColumnType.COLUMN_TYPE_INT }, + projectId: { name: "project_id", type: ColumnType.COLUMN_TYPE_INT }, + resourceId: { name: "resource_id", type: ColumnType.COLUMN_TYPE_INT }, + projectPhaseId: { name: "project_phase_id", type: ColumnType.COLUMN_TYPE_INT }, + uploadTypeId: { name: "upload_type_id", type: ColumnType.COLUMN_TYPE_INT }, + url: { name: "url", type: ColumnType.COLUMN_TYPE_STRING }, + uploadStatusId: { name: "upload_status_id", type: ColumnType.COLUMN_TYPE_INT }, + parameter: { name: "parameter", type: ColumnType.COLUMN_TYPE_STRING }, + ...AuditColumns, + }, +}; diff --git a/src/server.ts b/src/server.ts index e163d9f..9e35e24 100644 --- a/src/server.ts +++ b/src/server.ts @@ -27,6 +27,7 @@ import { LegacyProjectInfoServer, LegacyProjectInfoService } from "./service/Pro import { LegacyResourceServer, LegacyResourceService } from "./service/Resource"; import { LegacyReviewServer, LegacyReviewService } from "./service/Review"; import { LegacyTermServer, LegacyTermService } from "./service/Term"; +import { LegacyUploadServer, LegacyUploadService } from "./service/LegacyUpload"; const server = new Server({ "grpc.max_send_message_length": -1, @@ -49,6 +50,7 @@ server.addService(LegacyResourceService, new LegacyResourceServer()); server.addService(LegacyGroupContestEligibilityService, new LegacyGroupContestEligibilityServer()); server.addService(LegacyChallengePaymentService, new LegacyChallengePaymentServer()); server.addService(LegacyPrizeServiceService, new LegacyPrizeServer()); +server.addService(LegacyUploadService, new LegacyUploadServer()); server.bindAsync( `${GRPC_SERVER_HOST}:${GRPC_SERVER_PORT}`, diff --git a/src/service/LegacySubmission.ts b/src/service/LegacySubmission.ts index 3fc545b..c93f447 100644 --- a/src/service/LegacySubmission.ts +++ b/src/service/LegacySubmission.ts @@ -42,7 +42,11 @@ class LegacySubmissionServerImpl implements LegacySubmissionServer { update: handleUnaryCall = ( call: ServerUnaryCall, callback: sendUnaryData - ) => { }; + ) => { + LegacySubmissionDomain.update(call.request) + .then((response) => callback(null, response)) + .catch((err) => callback(err, null)); + }; } -export { LegacySubmissionServerImpl as LegacySubmissionServer, LegacySubmissionService }; \ No newline at end of file +export { LegacySubmissionServerImpl as LegacySubmissionServer, LegacySubmissionService }; diff --git a/src/service/LegacyUpload.ts b/src/service/LegacyUpload.ts new file mode 100644 index 0000000..fd71c8e --- /dev/null +++ b/src/service/LegacyUpload.ts @@ -0,0 +1,52 @@ +import { handleUnaryCall, sendUnaryData, ServerUnaryCall, UntypedHandleCall } from "@grpc/grpc-js"; +import { CreateResult, Empty, LookupCriteria, ScanRequest, ScanResult, UpdateResult +} from "@topcoder-framework/lib-common"; +import LegacyUploadDomain from '../domain/LegacyUpload' + +import { LegacyUploadServer, LegacyUploadService } from '../models/domain-layer/legacy/services/upload'; +import { Upload, CreateUploadInput, DeleteUploadInput, UploadList, UpdateUploadInput } from "../models/domain-layer/legacy/upload"; + +class LegacyUploadServerImpl implements LegacyUploadServer { + [name: string]: UntypedHandleCall; + + scan: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { + // not implemented + }; + + lookup: handleUnaryCall + = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { + // not implemented + }; + + create: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { + // not implemented + }; + + delete: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { + // not implemented + }; + + + update: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { + LegacyUploadDomain.update(call.request) + .then((response) => callback(null, response)) + .catch((err) => callback(err, null)); + }; +} + +export { LegacyUploadServerImpl as LegacyUploadServer, LegacyUploadService }; From b092001911fcf8faf361c5f97d3b0f20316d5de2 Mon Sep 17 00:00:00 2001 From: Hamid Tavakoli Date: Wed, 8 Mar 2023 09:08:27 -0800 Subject: [PATCH 4/8] fix: wip --- src/config.ts | 2 +- .../legacy/long_component_state.ts | 116 ++-------- .../domain-layer/legacy/services/upload.ts | 19 +- src/models/domain-layer/legacy/submission.ts | 212 ++++++++---------- src/models/domain-layer/legacy/upload.ts | 99 ++++---- src/service/LegacySubmission.ts | 5 + 6 files changed, 197 insertions(+), 256 deletions(-) diff --git a/src/config.ts b/src/config.ts index a1215b8..1440ba8 100644 --- a/src/config.ts +++ b/src/config.ts @@ -2,7 +2,7 @@ import assert from "assert"; export const ENV = process.env.ENV || "local"; export const GRPC_SERVER_HOST = process.env.GRPC_SERVER_HOST || "localhost"; -export const GRPC_SERVER_PORT = process.env.GRPC_SERVER_PORT || 9091; +export const GRPC_SERVER_PORT = process.env.GRPC_SERVER_PORT || 9090; export const GRPC_RDB_SERVER_HOST = process.env.GRPC_RDB_SERVER_HOST; export const GRPC_RDB_SERVER_PORT = process.env.GRPC_RDB_SERVER_PORT; diff --git a/src/models/domain-layer/legacy/long_component_state.ts b/src/models/domain-layer/legacy/long_component_state.ts index eace3c4..6a44a15 100644 --- a/src/models/domain-layer/legacy/long_component_state.ts +++ b/src/models/domain-layer/legacy/long_component_state.ts @@ -1,5 +1,4 @@ /* eslint-disable */ -import { ScanCriteria } from "@topcoder-framework/lib-common"; import _m0 from "protobufjs/minimal"; export interface LongComponentState { @@ -24,11 +23,7 @@ export interface CreateLongComponentStateInput { } export interface UpdateLongComponentStateInput { - filterCriteria: ScanCriteria[]; - updateInput?: UpdateLongComponentStateInput_UpdateInput; -} - -export interface UpdateLongComponentStateInput_UpdateInput { + longComponentStateId: number; submissionNumber?: number | undefined; points?: number | undefined; } @@ -278,16 +273,19 @@ export const CreateLongComponentStateInput = { }; function createBaseUpdateLongComponentStateInput(): UpdateLongComponentStateInput { - return { filterCriteria: [], updateInput: undefined }; + return { longComponentStateId: 0, submissionNumber: undefined, points: undefined }; } export const UpdateLongComponentStateInput = { encode(message: UpdateLongComponentStateInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.filterCriteria) { - ScanCriteria.encode(v!, writer.uint32(10).fork()).ldelim(); + if (message.longComponentStateId !== 0) { + writer.uint32(8).int32(message.longComponentStateId); } - if (message.updateInput !== undefined) { - UpdateLongComponentStateInput_UpdateInput.encode(message.updateInput, writer.uint32(26).fork()).ldelim(); + if (message.submissionNumber !== undefined) { + writer.uint32(16).int32(message.submissionNumber); + } + if (message.points !== undefined) { + writer.uint32(24).int32(message.points); } return writer; }, @@ -300,10 +298,13 @@ export const UpdateLongComponentStateInput = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.filterCriteria.push(ScanCriteria.decode(reader, reader.uint32())); + message.longComponentStateId = reader.int32(); + break; + case 2: + message.submissionNumber = reader.int32(); break; case 3: - message.updateInput = UpdateLongComponentStateInput_UpdateInput.decode(reader, reader.uint32()); + message.points = reader.int32(); break; default: reader.skipType(tag & 7); @@ -315,25 +316,17 @@ export const UpdateLongComponentStateInput = { fromJSON(object: any): UpdateLongComponentStateInput { return { - filterCriteria: Array.isArray(object?.filterCriteria) - ? object.filterCriteria.map((e: any) => ScanCriteria.fromJSON(e)) - : [], - updateInput: isSet(object.updateInput) - ? UpdateLongComponentStateInput_UpdateInput.fromJSON(object.updateInput) - : undefined, + longComponentStateId: isSet(object.longComponentStateId) ? Number(object.longComponentStateId) : 0, + submissionNumber: isSet(object.submissionNumber) ? Number(object.submissionNumber) : undefined, + points: isSet(object.points) ? Number(object.points) : undefined, }; }, toJSON(message: UpdateLongComponentStateInput): unknown { const obj: any = {}; - if (message.filterCriteria) { - obj.filterCriteria = message.filterCriteria.map((e) => e ? ScanCriteria.toJSON(e) : undefined); - } else { - obj.filterCriteria = []; - } - message.updateInput !== undefined && (obj.updateInput = message.updateInput - ? UpdateLongComponentStateInput_UpdateInput.toJSON(message.updateInput) - : undefined); + message.longComponentStateId !== undefined && (obj.longComponentStateId = Math.round(message.longComponentStateId)); + message.submissionNumber !== undefined && (obj.submissionNumber = Math.round(message.submissionNumber)); + message.points !== undefined && (obj.points = Math.round(message.points)); return obj; }, @@ -345,74 +338,7 @@ export const UpdateLongComponentStateInput = { object: I, ): UpdateLongComponentStateInput { const message = createBaseUpdateLongComponentStateInput(); - message.filterCriteria = object.filterCriteria?.map((e) => ScanCriteria.fromPartial(e)) || []; - message.updateInput = (object.updateInput !== undefined && object.updateInput !== null) - ? UpdateLongComponentStateInput_UpdateInput.fromPartial(object.updateInput) - : undefined; - return message; - }, -}; - -function createBaseUpdateLongComponentStateInput_UpdateInput(): UpdateLongComponentStateInput_UpdateInput { - return { submissionNumber: undefined, points: undefined }; -} - -export const UpdateLongComponentStateInput_UpdateInput = { - encode(message: UpdateLongComponentStateInput_UpdateInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.submissionNumber !== undefined) { - writer.uint32(8).int32(message.submissionNumber); - } - if (message.points !== undefined) { - writer.uint32(16).int32(message.points); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateLongComponentStateInput_UpdateInput { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateLongComponentStateInput_UpdateInput(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.submissionNumber = reader.int32(); - break; - case 2: - message.points = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UpdateLongComponentStateInput_UpdateInput { - return { - submissionNumber: isSet(object.submissionNumber) ? Number(object.submissionNumber) : undefined, - points: isSet(object.points) ? Number(object.points) : undefined, - }; - }, - - toJSON(message: UpdateLongComponentStateInput_UpdateInput): unknown { - const obj: any = {}; - message.submissionNumber !== undefined && (obj.submissionNumber = Math.round(message.submissionNumber)); - message.points !== undefined && (obj.points = Math.round(message.points)); - return obj; - }, - - create, I>>( - base?: I, - ): UpdateLongComponentStateInput_UpdateInput { - return UpdateLongComponentStateInput_UpdateInput.fromPartial(base ?? {}); - }, - - fromPartial, I>>( - object: I, - ): UpdateLongComponentStateInput_UpdateInput { - const message = createBaseUpdateLongComponentStateInput_UpdateInput(); + message.longComponentStateId = object.longComponentStateId ?? 0; message.submissionNumber = object.submissionNumber ?? undefined; message.points = object.points ?? undefined; return message; diff --git a/src/models/domain-layer/legacy/services/upload.ts b/src/models/domain-layer/legacy/services/upload.ts index 8a6fd10..ffc6a31 100644 --- a/src/models/domain-layer/legacy/services/upload.ts +++ b/src/models/domain-layer/legacy/services/upload.ts @@ -1,6 +1,13 @@ /* eslint-disable */ import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; -import { CreateResult, LookupCriteria, ScanRequest, ScanResult, UpdateResult } from "@topcoder-framework/lib-common"; +import { + CreateResult, + Empty, + LookupCriteria, + ScanRequest, + ScanResult, + UpdateResult, +} from "@topcoder-framework/lib-common"; import { CreateUploadInput, UpdateUploadInput, Upload } from "../upload"; export type LegacyUploadService = typeof LegacyUploadService; @@ -41,6 +48,15 @@ export const LegacyUploadService = { responseSerialize: (value: UpdateResult) => Buffer.from(UpdateResult.encode(value).finish()), responseDeserialize: (value: Buffer) => UpdateResult.decode(value), }, + delete: { + path: "/topcoder.domain.service.legacy_upload.LegacyUpload/Delete", + requestStream: false, + responseStream: false, + requestSerialize: (value: LookupCriteria) => Buffer.from(LookupCriteria.encode(value).finish()), + requestDeserialize: (value: Buffer) => LookupCriteria.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, } as const; export interface LegacyUploadServer extends UntypedServiceImplementation { @@ -48,4 +64,5 @@ export interface LegacyUploadServer extends UntypedServiceImplementation { lookup: handleUnaryCall; create: handleUnaryCall; update: handleUnaryCall; + delete: handleUnaryCall; } diff --git a/src/models/domain-layer/legacy/submission.ts b/src/models/domain-layer/legacy/submission.ts index ad511f6..2029b39 100644 --- a/src/models/domain-layer/legacy/submission.ts +++ b/src/models/domain-layer/legacy/submission.ts @@ -1,5 +1,4 @@ /* eslint-disable */ -import { ScanCriteria } from "@topcoder-framework/lib-common"; import Long from "long"; import _m0 from "protobufjs/minimal"; @@ -8,6 +7,9 @@ export interface LegacySubmission { submissionStatusId: number; submissionTypeId: number; uploadId: number; + screeningScore: number; + initialScore: number; + finalScore: number; createUser: number; createDate: number; modifyUser: number; @@ -34,15 +36,13 @@ export interface CreateSubmissionInput { } export interface UpdateSubmissionInput { - filterCriteria: ScanCriteria[]; - updateInput?: UpdateSubmissionInput_UpdateInput; -} - -export interface UpdateSubmissionInput_UpdateInput { submissionId: number; - submissionStatusId: number; - submissionTypeId: number; - uploadId: number; + submissionStatusId?: number | undefined; + submissionTypeId?: number | undefined; + uploadId?: number | undefined; + screeningScore?: number | undefined; + initialScore?: number | undefined; + finalScore?: number | undefined; } function createBaseLegacySubmission(): LegacySubmission { @@ -51,6 +51,9 @@ function createBaseLegacySubmission(): LegacySubmission { submissionStatusId: 0, submissionTypeId: 0, uploadId: 0, + screeningScore: 0, + initialScore: 0, + finalScore: 0, createUser: 0, createDate: 0, modifyUser: 0, @@ -72,17 +75,26 @@ export const LegacySubmission = { if (message.uploadId !== 0) { writer.uint32(32).int32(message.uploadId); } + if (message.screeningScore !== 0) { + writer.uint32(40).int32(message.screeningScore); + } + if (message.initialScore !== 0) { + writer.uint32(48).int32(message.initialScore); + } + if (message.finalScore !== 0) { + writer.uint32(56).int32(message.finalScore); + } if (message.createUser !== 0) { - writer.uint32(40).int32(message.createUser); + writer.uint32(64).int32(message.createUser); } if (message.createDate !== 0) { - writer.uint32(48).int64(message.createDate); + writer.uint32(72).int64(message.createDate); } if (message.modifyUser !== 0) { - writer.uint32(56).int32(message.modifyUser); + writer.uint32(80).int32(message.modifyUser); } if (message.modifyDate !== 0) { - writer.uint32(64).int64(message.modifyDate); + writer.uint32(88).int64(message.modifyDate); } return writer; }, @@ -107,15 +119,24 @@ export const LegacySubmission = { message.uploadId = reader.int32(); break; case 5: - message.createUser = reader.int32(); + message.screeningScore = reader.int32(); break; case 6: - message.createDate = longToNumber(reader.int64() as Long); + message.initialScore = reader.int32(); break; case 7: - message.modifyUser = reader.int32(); + message.finalScore = reader.int32(); break; case 8: + message.createUser = reader.int32(); + break; + case 9: + message.createDate = longToNumber(reader.int64() as Long); + break; + case 10: + message.modifyUser = reader.int32(); + break; + case 11: message.modifyDate = longToNumber(reader.int64() as Long); break; default: @@ -132,6 +153,9 @@ export const LegacySubmission = { submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + screeningScore: isSet(object.screeningScore) ? Number(object.screeningScore) : 0, + initialScore: isSet(object.initialScore) ? Number(object.initialScore) : 0, + finalScore: isSet(object.finalScore) ? Number(object.finalScore) : 0, createUser: isSet(object.createUser) ? Number(object.createUser) : 0, createDate: isSet(object.createDate) ? Number(object.createDate) : 0, modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, @@ -145,6 +169,9 @@ export const LegacySubmission = { message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.screeningScore !== undefined && (obj.screeningScore = Math.round(message.screeningScore)); + message.initialScore !== undefined && (obj.initialScore = Math.round(message.initialScore)); + message.finalScore !== undefined && (obj.finalScore = Math.round(message.finalScore)); message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); message.createDate !== undefined && (obj.createDate = Math.round(message.createDate)); message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); @@ -162,6 +189,9 @@ export const LegacySubmission = { message.submissionStatusId = object.submissionStatusId ?? 0; message.submissionTypeId = object.submissionTypeId ?? 0; message.uploadId = object.uploadId ?? 0; + message.screeningScore = object.screeningScore ?? 0; + message.initialScore = object.initialScore ?? 0; + message.finalScore = object.finalScore ?? 0; message.createUser = object.createUser ?? 0; message.createDate = object.createDate ?? 0; message.modifyUser = object.modifyUser ?? 0; @@ -376,105 +406,47 @@ export const CreateSubmissionInput = { }; function createBaseUpdateSubmissionInput(): UpdateSubmissionInput { - return { filterCriteria: [], updateInput: undefined }; + return { + submissionId: 0, + submissionStatusId: undefined, + submissionTypeId: undefined, + uploadId: undefined, + screeningScore: undefined, + initialScore: undefined, + finalScore: undefined, + }; } export const UpdateSubmissionInput = { encode(message: UpdateSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.filterCriteria) { - ScanCriteria.encode(v!, writer.uint32(10).fork()).ldelim(); - } - if (message.updateInput !== undefined) { - UpdateSubmissionInput_UpdateInput.encode(message.updateInput, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSubmissionInput { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateSubmissionInput(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.filterCriteria.push(ScanCriteria.decode(reader, reader.uint32())); - break; - case 3: - message.updateInput = UpdateSubmissionInput_UpdateInput.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UpdateSubmissionInput { - return { - filterCriteria: Array.isArray(object?.filterCriteria) - ? object.filterCriteria.map((e: any) => ScanCriteria.fromJSON(e)) - : [], - updateInput: isSet(object.updateInput) - ? UpdateSubmissionInput_UpdateInput.fromJSON(object.updateInput) - : undefined, - }; - }, - - toJSON(message: UpdateSubmissionInput): unknown { - const obj: any = {}; - if (message.filterCriteria) { - obj.filterCriteria = message.filterCriteria.map((e) => e ? ScanCriteria.toJSON(e) : undefined); - } else { - obj.filterCriteria = []; - } - message.updateInput !== undefined && - (obj.updateInput = message.updateInput - ? UpdateSubmissionInput_UpdateInput.toJSON(message.updateInput) - : undefined); - return obj; - }, - - create, I>>(base?: I): UpdateSubmissionInput { - return UpdateSubmissionInput.fromPartial(base ?? {}); - }, - - fromPartial, I>>(object: I): UpdateSubmissionInput { - const message = createBaseUpdateSubmissionInput(); - message.filterCriteria = object.filterCriteria?.map((e) => ScanCriteria.fromPartial(e)) || []; - message.updateInput = (object.updateInput !== undefined && object.updateInput !== null) - ? UpdateSubmissionInput_UpdateInput.fromPartial(object.updateInput) - : undefined; - return message; - }, -}; - -function createBaseUpdateSubmissionInput_UpdateInput(): UpdateSubmissionInput_UpdateInput { - return { submissionId: 0, submissionStatusId: 0, submissionTypeId: 0, uploadId: 0 }; -} - -export const UpdateSubmissionInput_UpdateInput = { - encode(message: UpdateSubmissionInput_UpdateInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { if (message.submissionId !== 0) { writer.uint32(8).int32(message.submissionId); } - if (message.submissionStatusId !== 0) { + if (message.submissionStatusId !== undefined) { writer.uint32(16).int32(message.submissionStatusId); } - if (message.submissionTypeId !== 0) { + if (message.submissionTypeId !== undefined) { writer.uint32(24).int32(message.submissionTypeId); } - if (message.uploadId !== 0) { + if (message.uploadId !== undefined) { writer.uint32(32).int32(message.uploadId); } + if (message.screeningScore !== undefined) { + writer.uint32(40).int32(message.screeningScore); + } + if (message.initialScore !== undefined) { + writer.uint32(48).int32(message.initialScore); + } + if (message.finalScore !== undefined) { + writer.uint32(56).int32(message.finalScore); + } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSubmissionInput_UpdateInput { + decode(input: _m0.Reader | Uint8Array, length?: number): UpdateSubmissionInput { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateSubmissionInput_UpdateInput(); + const message = createBaseUpdateSubmissionInput(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { @@ -490,6 +462,15 @@ export const UpdateSubmissionInput_UpdateInput = { case 4: message.uploadId = reader.int32(); break; + case 5: + message.screeningScore = reader.int32(); + break; + case 6: + message.initialScore = reader.int32(); + break; + case 7: + message.finalScore = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -498,38 +479,43 @@ export const UpdateSubmissionInput_UpdateInput = { return message; }, - fromJSON(object: any): UpdateSubmissionInput_UpdateInput { + fromJSON(object: any): UpdateSubmissionInput { return { submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, - submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, - submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, - uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : undefined, + submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : undefined, + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : undefined, + screeningScore: isSet(object.screeningScore) ? Number(object.screeningScore) : undefined, + initialScore: isSet(object.initialScore) ? Number(object.initialScore) : undefined, + finalScore: isSet(object.finalScore) ? Number(object.finalScore) : undefined, }; }, - toJSON(message: UpdateSubmissionInput_UpdateInput): unknown { + toJSON(message: UpdateSubmissionInput): unknown { const obj: any = {}; message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.screeningScore !== undefined && (obj.screeningScore = Math.round(message.screeningScore)); + message.initialScore !== undefined && (obj.initialScore = Math.round(message.initialScore)); + message.finalScore !== undefined && (obj.finalScore = Math.round(message.finalScore)); return obj; }, - create, I>>( - base?: I, - ): UpdateSubmissionInput_UpdateInput { - return UpdateSubmissionInput_UpdateInput.fromPartial(base ?? {}); + create, I>>(base?: I): UpdateSubmissionInput { + return UpdateSubmissionInput.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): UpdateSubmissionInput_UpdateInput { - const message = createBaseUpdateSubmissionInput_UpdateInput(); + fromPartial, I>>(object: I): UpdateSubmissionInput { + const message = createBaseUpdateSubmissionInput(); message.submissionId = object.submissionId ?? 0; - message.submissionStatusId = object.submissionStatusId ?? 0; - message.submissionTypeId = object.submissionTypeId ?? 0; - message.uploadId = object.uploadId ?? 0; + message.submissionStatusId = object.submissionStatusId ?? undefined; + message.submissionTypeId = object.submissionTypeId ?? undefined; + message.uploadId = object.uploadId ?? undefined; + message.screeningScore = object.screeningScore ?? undefined; + message.initialScore = object.initialScore ?? undefined; + message.finalScore = object.finalScore ?? undefined; return message; }, }; diff --git a/src/models/domain-layer/legacy/upload.ts b/src/models/domain-layer/legacy/upload.ts index f261cb7..ab07695 100644 --- a/src/models/domain-layer/legacy/upload.ts +++ b/src/models/domain-layer/legacy/upload.ts @@ -36,12 +36,13 @@ export interface CreateUploadInput { } export interface UpdateUploadInput { - filterCriteria: ScanCriteria[]; - updateInput?: UpdateUploadInput_UpdateInput; + uploadId: number; + url?: string | undefined; + uploadStatusId?: number | undefined; } -export interface UpdateUploadInput_UpdateInput { - url: string; +export interface DeleteUploadInput { + filterCriteria: ScanCriteria[]; } function createBaseUpload(): Upload { @@ -423,16 +424,19 @@ export const CreateUploadInput = { }; function createBaseUpdateUploadInput(): UpdateUploadInput { - return { filterCriteria: [], updateInput: undefined }; + return { uploadId: 0, url: undefined, uploadStatusId: undefined }; } export const UpdateUploadInput = { encode(message: UpdateUploadInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - for (const v of message.filterCriteria) { - ScanCriteria.encode(v!, writer.uint32(10).fork()).ldelim(); + if (message.uploadId !== 0) { + writer.uint32(8).int32(message.uploadId); + } + if (message.url !== undefined) { + writer.uint32(18).string(message.url); } - if (message.updateInput !== undefined) { - UpdateUploadInput_UpdateInput.encode(message.updateInput, writer.uint32(26).fork()).ldelim(); + if (message.uploadStatusId !== undefined) { + writer.uint32(24).int32(message.uploadStatusId); } return writer; }, @@ -445,10 +449,13 @@ export const UpdateUploadInput = { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.filterCriteria.push(ScanCriteria.decode(reader, reader.uint32())); + message.uploadId = reader.int32(); + break; + case 2: + message.url = reader.string(); break; case 3: - message.updateInput = UpdateUploadInput_UpdateInput.decode(reader, reader.uint32()); + message.uploadStatusId = reader.int32(); break; default: reader.skipType(tag & 7); @@ -460,22 +467,17 @@ export const UpdateUploadInput = { fromJSON(object: any): UpdateUploadInput { return { - filterCriteria: Array.isArray(object?.filterCriteria) - ? object.filterCriteria.map((e: any) => ScanCriteria.fromJSON(e)) - : [], - updateInput: isSet(object.updateInput) ? UpdateUploadInput_UpdateInput.fromJSON(object.updateInput) : undefined, + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + url: isSet(object.url) ? String(object.url) : undefined, + uploadStatusId: isSet(object.uploadStatusId) ? Number(object.uploadStatusId) : undefined, }; }, toJSON(message: UpdateUploadInput): unknown { const obj: any = {}; - if (message.filterCriteria) { - obj.filterCriteria = message.filterCriteria.map((e) => e ? ScanCriteria.toJSON(e) : undefined); - } else { - obj.filterCriteria = []; - } - message.updateInput !== undefined && - (obj.updateInput = message.updateInput ? UpdateUploadInput_UpdateInput.toJSON(message.updateInput) : undefined); + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + message.url !== undefined && (obj.url = message.url); + message.uploadStatusId !== undefined && (obj.uploadStatusId = Math.round(message.uploadStatusId)); return obj; }, @@ -485,35 +487,34 @@ export const UpdateUploadInput = { fromPartial, I>>(object: I): UpdateUploadInput { const message = createBaseUpdateUploadInput(); - message.filterCriteria = object.filterCriteria?.map((e) => ScanCriteria.fromPartial(e)) || []; - message.updateInput = (object.updateInput !== undefined && object.updateInput !== null) - ? UpdateUploadInput_UpdateInput.fromPartial(object.updateInput) - : undefined; + message.uploadId = object.uploadId ?? 0; + message.url = object.url ?? undefined; + message.uploadStatusId = object.uploadStatusId ?? undefined; return message; }, }; -function createBaseUpdateUploadInput_UpdateInput(): UpdateUploadInput_UpdateInput { - return { url: "" }; +function createBaseDeleteUploadInput(): DeleteUploadInput { + return { filterCriteria: [] }; } -export const UpdateUploadInput_UpdateInput = { - encode(message: UpdateUploadInput_UpdateInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.url !== "") { - writer.uint32(10).string(message.url); +export const DeleteUploadInput = { + encode(message: DeleteUploadInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + for (const v of message.filterCriteria) { + ScanCriteria.encode(v!, writer.uint32(10).fork()).ldelim(); } return writer; }, - decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUploadInput_UpdateInput { + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteUploadInput { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUpdateUploadInput_UpdateInput(); + const message = createBaseDeleteUploadInput(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.url = reader.string(); + message.filterCriteria.push(ScanCriteria.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -523,25 +524,31 @@ export const UpdateUploadInput_UpdateInput = { return message; }, - fromJSON(object: any): UpdateUploadInput_UpdateInput { - return { url: isSet(object.url) ? String(object.url) : "" }; + fromJSON(object: any): DeleteUploadInput { + return { + filterCriteria: Array.isArray(object?.filterCriteria) + ? object.filterCriteria.map((e: any) => ScanCriteria.fromJSON(e)) + : [], + }; }, - toJSON(message: UpdateUploadInput_UpdateInput): unknown { + toJSON(message: DeleteUploadInput): unknown { const obj: any = {}; - message.url !== undefined && (obj.url = message.url); + if (message.filterCriteria) { + obj.filterCriteria = message.filterCriteria.map((e) => e ? ScanCriteria.toJSON(e) : undefined); + } else { + obj.filterCriteria = []; + } return obj; }, - create, I>>(base?: I): UpdateUploadInput_UpdateInput { - return UpdateUploadInput_UpdateInput.fromPartial(base ?? {}); + create, I>>(base?: I): DeleteUploadInput { + return DeleteUploadInput.fromPartial(base ?? {}); }, - fromPartial, I>>( - object: I, - ): UpdateUploadInput_UpdateInput { - const message = createBaseUpdateUploadInput_UpdateInput(); - message.url = object.url ?? ""; + fromPartial, I>>(object: I): DeleteUploadInput { + const message = createBaseDeleteUploadInput(); + message.filterCriteria = object.filterCriteria?.map((e) => ScanCriteria.fromPartial(e)) || []; return message; }, }; diff --git a/src/service/LegacySubmission.ts b/src/service/LegacySubmission.ts index 62657d5..4939d23 100644 --- a/src/service/LegacySubmission.ts +++ b/src/service/LegacySubmission.ts @@ -33,6 +33,11 @@ class LegacySubmissionServerImpl implements LegacySubmissionServer { callback: sendUnaryData ) => { }; + scan: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { }; + get: handleUnaryCall = ( call: ServerUnaryCall, From c848a1b1db17f5f5cf7520c53d13583f6b4d774d Mon Sep 17 00:00:00 2001 From: Hamid Tavakoli Date: Thu, 9 Mar 2023 20:53:48 -0800 Subject: [PATCH 5/8] feat: wip --- src/domain/LegacySubmission.ts | 177 +++++++++--------- .../query-helper/SubmissionQueryHelper.ts | 2 +- src/models/domain-layer/legacy/submission.ts | 33 ---- src/service/LegacySubmission.ts | 2 +- 4 files changed, 95 insertions(+), 119 deletions(-) diff --git a/src/domain/LegacySubmission.ts b/src/domain/LegacySubmission.ts index cab2140..2d5bf78 100644 --- a/src/domain/LegacySubmission.ts +++ b/src/domain/LegacySubmission.ts @@ -1,6 +1,7 @@ -import { Query, QueryBuilder, QueryResult } from "@topcoder-framework/client-relational"; +import { Operator, Query, QueryBuilder, QueryResult } from "@topcoder-framework/client-relational"; import { UpdateResult } from "@topcoder-framework/lib-common"; import { Util } from "../common/Util"; +import moment from "moment"; import SubmissionQueryHelper from "../helper/query-helper/SubmissionQueryHelper"; import { queryRunner } from "../helper/QueryRunner"; import { @@ -14,98 +15,106 @@ const submissionTypes = { 'Checkpoint Submission': { id: 3, roleId: 1 }, 'Studio Final Fix Submission': { id: 4, roleId: 1 } } + +const submissionStatus = { + Active: 1, + Deleted: 5 +} class LegacySubmissionDomain { public async checkSubmissionExists(legacySubmissionId: number): Promise { - // const { projectId } = SubmissionSchema.columns; - - // const query = new QueryBuilder(SubmissionSchema) - // .select(projectId) - // .where(projectId, Operator.OPERATOR_EQUAL, { - // value: { - // $case: "intValue", - // intValue: legacySubmissionId, - // }, - // }) - // .limit(1) - // .build(); - - // const { rows } = await queryRunner.run(query); - - // return { - // exists: rows?.length == 1, - // }; + const { submissionId } = LegacySubmissionSchema.columns; + + const query = new QueryBuilder(LegacySubmissionSchema) + .select(submissionId) + .where(submissionId, Operator.OPERATOR_EQUAL, { + value: { + $case: "intValue", + intValue: legacySubmissionId, + }, + }) + .limit(1) + .build(); + + const { rows } = await queryRunner.run(query); + + return { + exists: rows?.length == 1, + }; } - public async createLegacySubmission(input: CreateSubmissionInput): Promise { - // eslint-disable-next-line - const subRoleId: string = (submissionTypes as any)[input.type].roleId; + public async create(input: CreateSubmissionInput): Promise { + // eslint-disable-next-line + const subRoleId: string | undefined = (submissionTypes as any)[input.type] ? (submissionTypes as any)[input.type].roleId : undefined; + if (!subRoleId) throw new Error('Invalid submission type') const challengePropertiesQuery = SubmissionQueryHelper - .getChallengeProperties(input.challengeId, input.memberId, subRoleId, input.submissionPhaseId); - - const { rows }: QueryResult = await queryRunner.run(challengePropertiesQuery); - console.log(rows) - return 0 - - // const createLegacySubmissionQuery = new QueryBuilder(SubmissionSchema) - // .insert({ - // submissionStatusId: input.submissionStatusId, - // submissionTypeId: input.submissionTypeId, - // uploadId: input.uploadId, - // }) - // .build(); - // if (createLegacySubmissionQueryResult instanceof Error) { - // transaction.rollback(); - // return Promise.reject({ - // message: "Failed to create legacy submission", - // }); - // } - - // const { lastInsertId: legacySubmissionId } = createLegacySubmissionQueryResult; - - // return Promise.resolve(legacySubmissionId!); + .getChallengeProperties(input.legacyChallengeId ?? 0, input.memberId, subRoleId, input.submissionPhaseId); + + //TODO: We do not need this but check + await queryRunner.run(challengePropertiesQuery); + + const insertSubmissionQuery = new QueryBuilder(LegacySubmissionSchema) + .insert({ + submission_status_id: submissionStatus.Active, + // eslint-disable-next-line + submission_type_id: (submissionTypes as any)[input.type].id, + parameter: 'N/A', + create_user: input.memberId, + create_date: moment(input.created).format('YYYY-MM-DD HH:mm:ss'), + modify_user: input.memberId, + modify_date: moment(input.created).format('YYYY-MM-DD HH:mm:ss') + }) + .build(); + + + const { rows }: QueryResult = await queryRunner.run(insertSubmissionQuery); + + + const { lastInsertId: legacySubmissionId } = createLegacySubmissionQueryResult; + + return Promise.resolve(legacySubmissionId!); + } + + public async listAvailableSubmissionInfoTypes(key: string): Promise { + const queryRequest: QueryRequest = { + query: { + query: { + $case: "select", + select: { + table: "project_info_type_lu", + join: [], + column: [ + { + name: "", + type: ColumnType.COLUMN_TYPE_INT, + }, + ], + where: [ + { + key: "name", + operator: Operator.OPERATOR_EQUAL, + value: { + value: { + $case: "stringValue", + stringValue: key, + }, + }, + }, + ], + groupBy: [], + orderBy: [], + limit: 1, + offset: 0, + }, + }, + }, + }; + return Promise.resolve(10); } - // public async listAvailableSubmissionInfoTypes(key: string): Promise { - // const queryRequest: QueryRequest = { - // query: { - // query: { - // $case: "select", - // select: { - // table: "project_info_type_lu", - // join: [], - // column: [ - // { - // name: "", - // type: ColumnType.COLUMN_TYPE_INT, - // }, - // ], - // where: [ - // { - // key: "name", - // operator: Operator.OPERATOR_EQUAL, - // value: { - // value: { - // $case: "stringValue", - // stringValue: key, - // }, - // }, - // }, - // ], - // groupBy: [], - // orderBy: [], - // limit: 1, - // offset: 0, - // }, - // }, - // }, - // }; - // return Promise.resolve(10); - // } - - public async update(input: UpdateSubmissionInput): Promise { + public async update(input: UpdateSubmissionInput): Promise { const query: Query = new QueryBuilder(LegacySubmissionSchema) .update({ ...input }) - .where(...Util.toScanCriteria({ ...input } as { [key: string]: number|string|undefined })) + .where(...Util.toScanCriteria({ ...input } as { [key: string]: number | string | undefined })) .build(); const { affectedRows } = await queryRunner.run(query); diff --git a/src/helper/query-helper/SubmissionQueryHelper.ts b/src/helper/query-helper/SubmissionQueryHelper.ts index dfaf571..a5f6908 100644 --- a/src/helper/query-helper/SubmissionQueryHelper.ts +++ b/src/helper/query-helper/SubmissionQueryHelper.ts @@ -1,7 +1,7 @@ import { Query } from "@topcoder-framework/client-relational"; class SubmissionQueryHelper { - public getChallengeProperties(challengeId: string, userId: number, resourceRoleId: string, phaseId: string): Query { + public getChallengeProperties(challengeId: number, userId: number, resourceRoleId: string, phaseId: string): Query { return { query: { $case: "raw", diff --git a/src/models/domain-layer/legacy/submission.ts b/src/models/domain-layer/legacy/submission.ts index 2029b39..610b96e 100644 --- a/src/models/domain-layer/legacy/submission.ts +++ b/src/models/domain-layer/legacy/submission.ts @@ -17,9 +17,6 @@ export interface LegacySubmission { } export interface CreateSubmissionInput { - submissionStatusId: number; - submissionTypeId: number; - uploadId: number; challengeId: string; created: number; fileType: string; @@ -202,9 +199,6 @@ export const LegacySubmission = { function createBaseCreateSubmissionInput(): CreateSubmissionInput { return { - submissionStatusId: 0, - submissionTypeId: 0, - uploadId: 0, challengeId: "", created: 0, fileType: "", @@ -223,15 +217,6 @@ function createBaseCreateSubmissionInput(): CreateSubmissionInput { export const CreateSubmissionInput = { encode(message: CreateSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.submissionStatusId !== 0) { - writer.uint32(8).int32(message.submissionStatusId); - } - if (message.submissionTypeId !== 0) { - writer.uint32(16).int32(message.submissionTypeId); - } - if (message.uploadId !== 0) { - writer.uint32(24).int32(message.uploadId); - } if (message.challengeId !== "") { writer.uint32(34).string(message.challengeId); } @@ -281,15 +266,6 @@ export const CreateSubmissionInput = { while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.submissionStatusId = reader.int32(); - break; - case 2: - message.submissionTypeId = reader.int32(); - break; - case 3: - message.uploadId = reader.int32(); - break; case 4: message.challengeId = reader.string(); break; @@ -339,9 +315,6 @@ export const CreateSubmissionInput = { fromJSON(object: any): CreateSubmissionInput { return { - submissionStatusId: isSet(object.submissionStatusId) ? Number(object.submissionStatusId) : 0, - submissionTypeId: isSet(object.submissionTypeId) ? Number(object.submissionTypeId) : 0, - uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, challengeId: isSet(object.challengeId) ? String(object.challengeId) : "", created: isSet(object.created) ? Number(object.created) : 0, fileType: isSet(object.fileType) ? String(object.fileType) : "", @@ -360,9 +333,6 @@ export const CreateSubmissionInput = { toJSON(message: CreateSubmissionInput): unknown { const obj: any = {}; - message.submissionStatusId !== undefined && (obj.submissionStatusId = Math.round(message.submissionStatusId)); - message.submissionTypeId !== undefined && (obj.submissionTypeId = Math.round(message.submissionTypeId)); - message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); message.challengeId !== undefined && (obj.challengeId = message.challengeId); message.created !== undefined && (obj.created = Math.round(message.created)); message.fileType !== undefined && (obj.fileType = message.fileType); @@ -385,9 +355,6 @@ export const CreateSubmissionInput = { fromPartial, I>>(object: I): CreateSubmissionInput { const message = createBaseCreateSubmissionInput(); - message.submissionStatusId = object.submissionStatusId ?? 0; - message.submissionTypeId = object.submissionTypeId ?? 0; - message.uploadId = object.uploadId ?? 0; message.challengeId = object.challengeId ?? ""; message.created = object.created ?? 0; message.fileType = object.fileType ?? ""; diff --git a/src/service/LegacySubmission.ts b/src/service/LegacySubmission.ts index a3436b9..108c459 100644 --- a/src/service/LegacySubmission.ts +++ b/src/service/LegacySubmission.ts @@ -16,7 +16,7 @@ class LegacySubmissionServerImpl implements LegacySubmissionServer { call: ServerUnaryCall, callback: sendUnaryData ) => { - LegacySubmissionDomain.createLegacySubmission(call.request) + LegacySubmissionDomain.create(call.request) .then((response) => callback(null, response)) //TODO: Fix this response type .catch((err) => callback(err, null)); }; From 6607becbfe570854cb6fddf94b7e62405db700be Mon Sep 17 00:00:00 2001 From: Hamid Tavakoli Date: Thu, 9 Mar 2023 21:44:04 -0800 Subject: [PATCH 6/8] feat:submission almost ready --- src/domain/LegacyResourceSubmission.ts | 19 +++++++ src/domain/LegacySubmission.ts | 30 +++++++--- .../legacy/resource_submission.ts | 10 ++-- .../legacy/services/submission.ts | 21 ++++++- src/models/domain-layer/legacy/submission.ts | 55 +++++++++++++++++++ src/service/LegacySubmission.ts | 38 +++++++------ 6 files changed, 139 insertions(+), 34 deletions(-) create mode 100644 src/domain/LegacyResourceSubmission.ts diff --git a/src/domain/LegacyResourceSubmission.ts b/src/domain/LegacyResourceSubmission.ts new file mode 100644 index 0000000..81ca017 --- /dev/null +++ b/src/domain/LegacyResourceSubmission.ts @@ -0,0 +1,19 @@ +import { CreateResourceSubmissionInput } from '../models/domain-layer/legacy/resource_submission'; +import { QueryBuilder } from '@topcoder-framework/client-relational'; +import { ResourceSubmissionSchema } from '../schema/resource/ResourceSubmission'; +import { queryRunner } from '../helper/QueryRunner'; + + +class LegacyResourceSubmissionDomain { + public async create(input: CreateResourceSubmissionInput): Promise { + const query = new QueryBuilder(ResourceSubmissionSchema) + .insert({ + submission_id: input.submissionId, + }) + .build(); + await queryRunner.run(query); + return true; + } +} + +export default new LegacyResourceSubmissionDomain(); \ No newline at end of file diff --git a/src/domain/LegacySubmission.ts b/src/domain/LegacySubmission.ts index 2d5bf78..71a5ce4 100644 --- a/src/domain/LegacySubmission.ts +++ b/src/domain/LegacySubmission.ts @@ -1,13 +1,14 @@ -import { Operator, Query, QueryBuilder, QueryResult } from "@topcoder-framework/client-relational"; -import { UpdateResult } from "@topcoder-framework/lib-common"; +import { ColumnType, Operator, Query, QueryBuilder, QueryRequest, QueryResult } from "@topcoder-framework/client-relational"; +import { CheckExistsResult, CreateResult, UpdateResult } from "@topcoder-framework/lib-common"; import { Util } from "../common/Util"; import moment from "moment"; import SubmissionQueryHelper from "../helper/query-helper/SubmissionQueryHelper"; import { queryRunner } from "../helper/QueryRunner"; import { - CreateSubmissionInput, UpdateSubmissionInput + CreateSubmissionInput, LegacySubmissionId, UpdateSubmissionInput } from "../models/domain-layer/legacy/submission"; import { LegacySubmissionSchema } from "../schema/submission/Submission"; +import LegacyResourceSubmissionDomain from "./LegacyResourceSubmission"; const submissionTypes = { 'Contest Submission': { id: 1, roleId: 1 }, @@ -21,7 +22,7 @@ const submissionStatus = { Deleted: 5 } class LegacySubmissionDomain { - public async checkSubmissionExists(legacySubmissionId: number): Promise { + public async checkSubmissionExists({ legacySubmissionId }: LegacySubmissionId): Promise { const { submissionId } = LegacySubmissionSchema.columns; const query = new QueryBuilder(LegacySubmissionSchema) @@ -42,10 +43,10 @@ class LegacySubmissionDomain { }; } - public async create(input: CreateSubmissionInput): Promise { + public async create(input: CreateSubmissionInput): Promise { // eslint-disable-next-line const subRoleId: string | undefined = (submissionTypes as any)[input.type] ? (submissionTypes as any)[input.type].roleId : undefined; - if (!subRoleId) throw new Error('Invalid submission type') + if (!subRoleId) return Promise.reject('Invalid submission type') const challengePropertiesQuery = SubmissionQueryHelper .getChallengeProperties(input.legacyChallengeId ?? 0, input.memberId, subRoleId, input.submissionPhaseId); @@ -66,15 +67,26 @@ class LegacySubmissionDomain { .build(); - const { rows }: QueryResult = await queryRunner.run(insertSubmissionQuery); + const { lastInsertId }: QueryResult = await queryRunner.run(insertSubmissionQuery); - const { lastInsertId: legacySubmissionId } = createLegacySubmissionQueryResult; - return Promise.resolve(legacySubmissionId!); + if (!lastInsertId) return Promise.reject('Error while creating submission') + await LegacyResourceSubmissionDomain.create({ + submissionId: lastInsertId + }); + return Promise.resolve({ + kind: { + $case: "integerId", + integerId: lastInsertId, + }, + }); } public async listAvailableSubmissionInfoTypes(key: string): Promise { + + //TODO : ask about this function + //ASK RAKIB const queryRequest: QueryRequest = { query: { query: { diff --git a/src/models/domain-layer/legacy/resource_submission.ts b/src/models/domain-layer/legacy/resource_submission.ts index 7ceb688..39b8062 100644 --- a/src/models/domain-layer/legacy/resource_submission.ts +++ b/src/models/domain-layer/legacy/resource_submission.ts @@ -12,7 +12,7 @@ export interface ResourceSubmission { } export interface CreateResourceSubmissionInput { - resourceId: number; + resourceId?: number | undefined; submissionId: number; } @@ -115,12 +115,12 @@ export const ResourceSubmission = { }; function createBaseCreateResourceSubmissionInput(): CreateResourceSubmissionInput { - return { resourceId: 0, submissionId: 0 }; + return { resourceId: undefined, submissionId: 0 }; } export const CreateResourceSubmissionInput = { encode(message: CreateResourceSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { - if (message.resourceId !== 0) { + if (message.resourceId !== undefined) { writer.uint32(8).int32(message.resourceId); } if (message.submissionId !== 0) { @@ -152,7 +152,7 @@ export const CreateResourceSubmissionInput = { fromJSON(object: any): CreateResourceSubmissionInput { return { - resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : undefined, submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, }; }, @@ -172,7 +172,7 @@ export const CreateResourceSubmissionInput = { object: I, ): CreateResourceSubmissionInput { const message = createBaseCreateResourceSubmissionInput(); - message.resourceId = object.resourceId ?? 0; + message.resourceId = object.resourceId ?? undefined; message.submissionId = object.submissionId ?? 0; return message; }, diff --git a/src/models/domain-layer/legacy/services/submission.ts b/src/models/domain-layer/legacy/services/submission.ts index b1c1367..44caca1 100644 --- a/src/models/domain-layer/legacy/services/submission.ts +++ b/src/models/domain-layer/legacy/services/submission.ts @@ -1,10 +1,26 @@ /* eslint-disable */ import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; -import { CreateResult, LookupCriteria, ScanRequest, ScanResult, UpdateResult } from "@topcoder-framework/lib-common"; -import { CreateSubmissionInput, LegacySubmission, UpdateSubmissionInput } from "../submission"; +import { + CheckExistsResult, + CreateResult, + LookupCriteria, + ScanRequest, + ScanResult, + UpdateResult, +} from "@topcoder-framework/lib-common"; +import { CreateSubmissionInput, LegacySubmission, LegacySubmissionId, UpdateSubmissionInput } from "../submission"; export type LegacySubmissionService = typeof LegacySubmissionService; export const LegacySubmissionService = { + checkExists: { + path: "/topcoder.domain.service.legacy_submission.LegacySubmission/CheckExists", + requestStream: false, + responseStream: false, + requestSerialize: (value: LegacySubmissionId) => Buffer.from(LegacySubmissionId.encode(value).finish()), + requestDeserialize: (value: Buffer) => LegacySubmissionId.decode(value), + responseSerialize: (value: CheckExistsResult) => Buffer.from(CheckExistsResult.encode(value).finish()), + responseDeserialize: (value: Buffer) => CheckExistsResult.decode(value), + }, scan: { path: "/topcoder.domain.service.legacy_submission.LegacySubmission/Scan", requestStream: false, @@ -44,6 +60,7 @@ export const LegacySubmissionService = { } as const; export interface LegacySubmissionServer extends UntypedServiceImplementation { + checkExists: handleUnaryCall; scan: handleUnaryCall; lookup: handleUnaryCall; create: handleUnaryCall; diff --git a/src/models/domain-layer/legacy/submission.ts b/src/models/domain-layer/legacy/submission.ts index 610b96e..29ef181 100644 --- a/src/models/domain-layer/legacy/submission.ts +++ b/src/models/domain-layer/legacy/submission.ts @@ -16,6 +16,10 @@ export interface LegacySubmission { modifyDate: number; } +export interface LegacySubmissionId { + legacySubmissionId: number; +} + export interface CreateSubmissionInput { challengeId: string; created: number; @@ -197,6 +201,57 @@ export const LegacySubmission = { }, }; +function createBaseLegacySubmissionId(): LegacySubmissionId { + return { legacySubmissionId: 0 }; +} + +export const LegacySubmissionId = { + encode(message: LegacySubmissionId, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.legacySubmissionId !== 0) { + writer.uint32(8).int32(message.legacySubmissionId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): LegacySubmissionId { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseLegacySubmissionId(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.legacySubmissionId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): LegacySubmissionId { + return { legacySubmissionId: isSet(object.legacySubmissionId) ? Number(object.legacySubmissionId) : 0 }; + }, + + toJSON(message: LegacySubmissionId): unknown { + const obj: any = {}; + message.legacySubmissionId !== undefined && (obj.legacySubmissionId = Math.round(message.legacySubmissionId)); + return obj; + }, + + create, I>>(base?: I): LegacySubmissionId { + return LegacySubmissionId.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): LegacySubmissionId { + const message = createBaseLegacySubmissionId(); + message.legacySubmissionId = object.legacySubmissionId ?? 0; + return message; + }, +}; + function createBaseCreateSubmissionInput(): CreateSubmissionInput { return { challengeId: "", diff --git a/src/service/LegacySubmission.ts b/src/service/LegacySubmission.ts index 108c459..379536e 100644 --- a/src/service/LegacySubmission.ts +++ b/src/service/LegacySubmission.ts @@ -1,14 +1,14 @@ import { handleUnaryCall, sendUnaryData, ServerUnaryCall, UntypedHandleCall } from "@grpc/grpc-js"; import { CreateResult, LookupCriteria, - CheckExistsResult, UpdateResult + CheckExistsResult, UpdateResult, ScanResult, ScanRequest } from "@topcoder-framework/lib-common"; import LegacySubmissionDomain from '../domain/LegacySubmission' import { LegacySubmissionService, LegacySubmissionServer } from '../models/domain-layer/legacy/services/submission'; import { CreateSubmissionInput, UpdateSubmissionInput, - LegacySubmission + LegacySubmission, LegacySubmissionId } from "../models/domain-layer/legacy/submission"; class LegacySubmissionServerImpl implements LegacySubmissionServer { @@ -17,7 +17,7 @@ class LegacySubmissionServerImpl implements LegacySubmissionServer { callback: sendUnaryData ) => { LegacySubmissionDomain.create(call.request) - .then((response) => callback(null, response)) //TODO: Fix this response type + .then((response) => callback(null, response)) .catch((err) => callback(err, null)); }; @@ -25,24 +25,26 @@ class LegacySubmissionServerImpl implements LegacySubmissionServer { checkExists: handleUnaryCall = ( call: ServerUnaryCall, callback: sendUnaryData - ) => { }; - - - lookup: handleUnaryCall = ( - call: ServerUnaryCall, - callback: sendUnaryData - ) => { }; - - scan: handleUnaryCall = ( - call: ServerUnaryCall, - callback: sendUnaryData - ) => { }; + ) => { + LegacySubmissionDomain.checkSubmissionExists(call.request) + .then((response) => callback(null, response)) + .catch((err) => callback(err, null)); + }; - get: handleUnaryCall = ( - call: ServerUnaryCall, + lookup: handleUnaryCall = ( + call: ServerUnaryCall, callback: sendUnaryData - ) => { }; + ) => { + //TODO: implement lookup + }; + + scan: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { + //TODO: implement scan + }; update: handleUnaryCall = ( call: ServerUnaryCall, From 3dad8fa05ea1a6cdbd604d4d4f2bf992d60a494a Mon Sep 17 00:00:00 2001 From: Hamid Tavakoli Date: Wed, 15 Mar 2023 19:26:24 -0600 Subject: [PATCH 7/8] feat: submission wip --- package.json | 3 +- src/config.ts | 3 + src/domain/LegacyResourceSubmission.ts | 22 +- src/domain/LegacySubmission.ts | 202 +++++++++++++----- src/domain/LegacyUpload.ts | 79 +++++-- .../query-helper/SubmissionQueryHelper.ts | 4 +- .../legacy/resource_submission.ts | 42 +++- .../legacy/services/submission.ts | 20 +- .../domain-layer/legacy/services/upload.ts | 13 +- src/models/domain-layer/legacy/submission.ts | 105 +++++++-- src/models/domain-layer/legacy/upload.ts | 132 +++++++++++- yarn.lock | 7 + 12 files changed, 532 insertions(+), 100 deletions(-) diff --git a/package.json b/package.json index b97e17d..cbef0d9 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "grpc-server-reflection": "^0.1.5", "lodash": "^4.17.21", "moment": "^2.29.4", + "moment-timezone": "^0.5.41", "source-map-support": "^0.5.21", "topcoder-interface": "github:topcoder-platform/plat-interface-definition#v0.0.23", "uuidv4": "^6.2.13" @@ -68,4 +69,4 @@ "node": "18.13.0", "yarn": "1.22.19" } -} \ No newline at end of file +} diff --git a/src/config.ts b/src/config.ts index 1440ba8..9c9812f 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,11 +1,14 @@ import assert from "assert"; export const ENV = process.env.ENV || "local"; +export const TIME_ZONE = process.env.TIME_ZONE || "America/New_York"; + export const GRPC_SERVER_HOST = process.env.GRPC_SERVER_HOST || "localhost"; export const GRPC_SERVER_PORT = process.env.GRPC_SERVER_PORT || 9090; export const GRPC_RDB_SERVER_HOST = process.env.GRPC_RDB_SERVER_HOST; export const GRPC_RDB_SERVER_PORT = process.env.GRPC_RDB_SERVER_PORT; + assert(GRPC_RDB_SERVER_HOST, "GRPC_RDB_SERVER_HOST is required"); assert(GRPC_RDB_SERVER_PORT, "GRPC_RDB_SERVER_PORT is required"); diff --git a/src/domain/LegacyResourceSubmission.ts b/src/domain/LegacyResourceSubmission.ts index 81ca017..7e3c089 100644 --- a/src/domain/LegacyResourceSubmission.ts +++ b/src/domain/LegacyResourceSubmission.ts @@ -1,16 +1,22 @@ -import { CreateResourceSubmissionInput } from '../models/domain-layer/legacy/resource_submission'; -import { QueryBuilder } from '@topcoder-framework/client-relational'; -import { ResourceSubmissionSchema } from '../schema/resource/ResourceSubmission'; -import { queryRunner } from '../helper/QueryRunner'; +import {QueryBuilder} from '@topcoder-framework/client-relational'; + +import {queryRunner} from '../helper/QueryRunner'; +import {CreateResourceSubmissionInput} from '../models/domain-layer/legacy/resource_submission'; +import {ResourceSubmissionSchema} from '../schema/resource/ResourceSubmission'; class LegacyResourceSubmissionDomain { public async create(input: CreateResourceSubmissionInput): Promise { const query = new QueryBuilder(ResourceSubmissionSchema) - .insert({ - submission_id: input.submissionId, - }) - .build(); + .insert({ + submission_id: input.submissionId, + resource_id: input.resourceId, + create_date: input.createDate, + update_date: input.updateDate, + create_user: input.createUser, + modeify_user: input.modifyUser + }) + .build(); await queryRunner.run(query); return true; } diff --git a/src/domain/LegacySubmission.ts b/src/domain/LegacySubmission.ts index 71a5ce4..7f1df34 100644 --- a/src/domain/LegacySubmission.ts +++ b/src/domain/LegacySubmission.ts @@ -1,14 +1,16 @@ -import { ColumnType, Operator, Query, QueryBuilder, QueryRequest, QueryResult } from "@topcoder-framework/client-relational"; -import { CheckExistsResult, CreateResult, UpdateResult } from "@topcoder-framework/lib-common"; -import { Util } from "../common/Util"; -import moment from "moment"; -import SubmissionQueryHelper from "../helper/query-helper/SubmissionQueryHelper"; -import { queryRunner } from "../helper/QueryRunner"; -import { - CreateSubmissionInput, LegacySubmissionId, UpdateSubmissionInput -} from "../models/domain-layer/legacy/submission"; -import { LegacySubmissionSchema } from "../schema/submission/Submission"; -import LegacyResourceSubmissionDomain from "./LegacyResourceSubmission"; +import { ColumnType, Operator, Query, QueryBuilder, QueryRequest, QueryResult } from '@topcoder-framework/client-relational'; +import { CheckExistsResult, CreateResult, UpdateResult } from '@topcoder-framework/lib-common'; +import momentTZ from 'moment-timezone'; + +import { Util } from '../common/Util'; +import { TIME_ZONE } from '../config'; +import SubmissionQueryHelper from '../helper/query-helper/SubmissionQueryHelper'; +import { queryRunner } from '../helper/QueryRunner'; +import { CreateSubmissionInput, DeleteChallengeSubmissionInput, LegacySubmissionId, UpdateSubmissionInput } from '../models/domain-layer/legacy/submission'; +import { LegacySubmissionSchema } from '../schema/submission/Submission'; + +import LegacyResourceSubmissionDomain from './LegacyResourceSubmission'; +import LegacyUploadDomain from './LegacyUpload'; const submissionTypes = { 'Contest Submission': { id: 1, roleId: 1 }, @@ -21,15 +23,40 @@ const submissionStatus = { Active: 1, Deleted: 5 } + +const phaseTypes = { + Submission: 2, + 'Final Fix': 9, + 'Specification Submission': 13 +} + + +const uploadTypes = { + Submission: 1, + 'Final Fix': 3 +} + +const CHALLENGE_TYPE = { + 'Component': 1, + 'Application': 2, + 'Studio': 3 +} + +const UPLOAD_STATUS = { + 'Active': 1, + 'Deleted': 2 +} + class LegacySubmissionDomain { - public async checkSubmissionExists({ legacySubmissionId }: LegacySubmissionId): Promise { + public async checkSubmissionExists({ legacySubmissionId }: LegacySubmissionId): + Promise { const { submissionId } = LegacySubmissionSchema.columns; const query = new QueryBuilder(LegacySubmissionSchema) .select(submissionId) .where(submissionId, Operator.OPERATOR_EQUAL, { value: { - $case: "intValue", + $case: 'intValue', intValue: legacySubmissionId, }, }) @@ -44,69 +71,127 @@ class LegacySubmissionDomain { } public async create(input: CreateSubmissionInput): Promise { - // eslint-disable-next-line - const subRoleId: string | undefined = (submissionTypes as any)[input.type] ? (submissionTypes as any)[input.type].roleId : undefined; + // eslint-disable-next-line + const subRoleId: string | undefined = (submissionTypes as any)[input.type] ? + (submissionTypes as any)[input.type].roleId : + undefined; if (!subRoleId) return Promise.reject('Invalid submission type') - const challengePropertiesQuery = SubmissionQueryHelper - .getChallengeProperties(input.legacyChallengeId ?? 0, input.memberId, subRoleId, input.submissionPhaseId); - - //TODO: We do not need this but check - await queryRunner.run(challengePropertiesQuery); - - const insertSubmissionQuery = new QueryBuilder(LegacySubmissionSchema) - .insert({ - submission_status_id: submissionStatus.Active, - // eslint-disable-next-line - submission_type_id: (submissionTypes as any)[input.type].id, - parameter: 'N/A', - create_user: input.memberId, - create_date: moment(input.created).format('YYYY-MM-DD HH:mm:ss'), - modify_user: input.memberId, - modify_date: moment(input.created).format('YYYY-MM-DD HH:mm:ss') - }) - .build(); + const challengePropertiesQuery = + SubmissionQueryHelper.getChallengeProperties( + input.legacyChallengeId, input.memberId, subRoleId, + input.submissionPhaseId); + + // TODO: We do not need this but check + const { rows } = await queryRunner.run(challengePropertiesQuery); + if (!rows || rows.length === 0) return Promise.reject('Error') + const { resourceId, phaseTypeId, value, challengeTypeId } = rows[0]; + const uploadType = phaseTypeId === phaseTypes['Final Fix'] ? + uploadTypes['Final Fix'] : + uploadTypes.Submission; - const { lastInsertId }: QueryResult = await queryRunner.run(insertSubmissionQuery); + let isAllowMultipleSubmission = true; + if (challengeTypeId === CHALLENGE_TYPE['Studio'] || value === 'true') { + isAllowMultipleSubmission = true; + } + const audits = { + createUser: input.memberId, + createDate: + momentTZ.tz(input.created, TIME_ZONE).format('YYYY-MM-DD HH:mm:ss'), + modifyUser: input.memberId, + modifyDate: + momentTZ.tz(input.created, TIME_ZONE).format('YYYY-MM-DD HH:mm:ss') + } + + const uploadResult = await LegacyUploadDomain.create({ + projectId: input.legacyChallengeId, + projectPhaseId: input.submissionPhaseId, + resourceId: resourceId, + uploadTypeId: uploadType, + url: input.url, + parameter: 'N/A', + uploadStatusId: UPLOAD_STATUS.Active, + ...audits + }); + if (!uploadResult.kind || uploadResult.kind.$case !== 'integerId') { + return Promise.reject('Error') + } + const uploadId = uploadResult.kind.integerId + const insertSubmissionQuery = + new QueryBuilder(LegacySubmissionSchema) + .insert({ + uploadId, + submission_status_id: submissionStatus.Active, + // eslint-disable-next-line + submission_type_id: (submissionTypes as any)[input.type].id, + ...audits + }) + .build(); - if (!lastInsertId) return Promise.reject('Error while creating submission') + + + const { lastInsertId }: QueryResult = + await queryRunner.run(insertSubmissionQuery); + + + if (!lastInsertId) { + return Promise.reject('Error while creating submission') + } await LegacyResourceSubmissionDomain.create({ - submissionId: lastInsertId + submissionId: lastInsertId, + resourceId: (resourceId as number), + ...audits }); + + if (!isAllowMultipleSubmission) { + await LegacyUploadDomain + .deleteSubmissionUpload({ + uploadId, + challengeId: input.legacyChallengeId, + resourceId: (resourceId as number), + }) + + await this.deleteChallengeSubmission({ + challengeId: input.legacyChallengeId, + resourceId: (resourceId as number), + }) + } + + + return Promise.resolve({ kind: { - $case: "integerId", + $case: 'integerId', integerId: lastInsertId, }, }); } public async listAvailableSubmissionInfoTypes(key: string): Promise { - - //TODO : ask about this function - //ASK RAKIB + // TODO : ask about this function + // ASK RAKIB const queryRequest: QueryRequest = { query: { query: { - $case: "select", + $case: 'select', select: { - table: "project_info_type_lu", + table: 'project_info_type_lu', join: [], column: [ { - name: "", + name: '', type: ColumnType.COLUMN_TYPE_INT, }, ], where: [ { - key: "name", + key: 'name', operator: Operator.OPERATOR_EQUAL, value: { value: { - $case: "stringValue", + $case: 'stringValue', stringValue: key, }, }, @@ -124,16 +209,31 @@ class LegacySubmissionDomain { } public async update(input: UpdateSubmissionInput): Promise { - const query: Query = new QueryBuilder(LegacySubmissionSchema) - .update({ ...input }) - .where(...Util.toScanCriteria({ ...input } as { [key: string]: number | string | undefined })) - .build(); + const query: Query = + new QueryBuilder(LegacySubmissionSchema) + .update({ ...input }) + .where(...Util.toScanCriteria( + { ...input } as { [key: string]: number | string | undefined })) + .build(); const { affectedRows } = await queryRunner.run(query); return { updatedCount: affectedRows || 0, } } -} -export default new LegacySubmissionDomain(); + public async deleteChallengeSubmission(input: DeleteChallengeSubmissionInput): + Promise { + await queryRunner.run({ + query: { + $case: 'raw', + raw: { + query: `update submission set submission_status_id =${submissionStatus['Deleted']} + where upload_id in (select upload_id from upload where project_id=${input.challengeId} and resource_id=${input.resourceId} + and upload_status_id=${UPLOAD_STATUS['Deleted']})`, + }, + }, + }) + } + + export default new LegacySubmissionDomain(); diff --git a/src/domain/LegacyUpload.ts b/src/domain/LegacyUpload.ts index d8d204e..8310668 100644 --- a/src/domain/LegacyUpload.ts +++ b/src/domain/LegacyUpload.ts @@ -1,24 +1,71 @@ -import { Query, QueryBuilder } from "@topcoder-framework/client-relational"; -import { UpdateResult } from "@topcoder-framework/lib-common"; -import { Util } from "../common/Util"; -import { queryRunner } from "../helper/QueryRunner"; -import { - UpdateUploadInput, -} from "../models/domain-layer/legacy/upload"; -import { UploadSchema } from "../schema/submission/Upload"; +import {Query, QueryBuilder} from '@topcoder-framework/client-relational'; +import {CreateResult, UpdateResult} from '@topcoder-framework/lib-common'; -class LegacySubmissionDomain { - public async update(input: UpdateUploadInput): Promise { - const query: Query = new QueryBuilder(UploadSchema) - .update({ ...input }) - .where(...Util.toScanCriteria({ ...input } as { [key: string]: number|string|undefined })) - .build(); +import {Util} from '../common/Util'; +import {queryRunner} from '../helper/QueryRunner'; +import {CreateUploadInput, DeleteSubmissionUploadInput, UpdateUploadInput} from '../models/domain-layer/legacy/upload'; +import {UploadSchema} from '../schema/submission/Upload'; - const { affectedRows } = await queryRunner.run(query); +const UPLOAD_STATUS = { + 'Active': 1, + 'Deleted': 2 +} + + +class LegacyUploadDomain { + public async update(input: UpdateUploadInput): Promise { + const query: Query = + new QueryBuilder(UploadSchema) + .update({...input}) + .where(...Util.toScanCriteria( + {...input} as {[key: string]: number | string | undefined})) + .build(); + + const {affectedRows} = await queryRunner.run(query); return { updatedCount: affectedRows || 0, } } + public async create(input: CreateUploadInput): Promise { + const {lastInsertId} = await queryRunner.run({ + query: { + $case: 'raw', + raw: { + query: `insert into upload( project_id, project_phase_id, resource_id, + upload_type_id, upload_status_id, parameter, url, create_user, create_date, modify_user, modify_date) + values( ${input.projectId}, ${input.projectPhaseId}, + ${input.resourceId}, ${input.uploadTypeId}, + ${input.uploadStatusId},${input.parameter}, + ${input.url}, ${input.createUser as number}, + ${input.createDate as string}, ${input.modifyUser as number}, + ${input.modifyDate as string})`, + }, + }, + }); + + if (!lastInsertId) return Promise.reject('Error while creating submission') + return Promise.resolve({ + kind: { + $case: 'integerId', + integerId: lastInsertId, + }, + }); + } + public async deleteSubmissionUpload(input: DeleteSubmissionUploadInput): + Promise { + await queryRunner.run({ + query: { + $case: 'raw', + raw: { + query: + `update upload set upload_status_id =${UPLOAD_STATUS['Deleted']} + where project_id=${input.challengeId as number} and + resource_id=${input.resourceId as number} and + upload_id <> ${input.uploadId as number}}`, + }, + }, + }) + } } -export default new LegacySubmissionDomain(); +export default new LegacyUploadDomain(); diff --git a/src/helper/query-helper/SubmissionQueryHelper.ts b/src/helper/query-helper/SubmissionQueryHelper.ts index a5f6908..6eb7ddc 100644 --- a/src/helper/query-helper/SubmissionQueryHelper.ts +++ b/src/helper/query-helper/SubmissionQueryHelper.ts @@ -1,7 +1,7 @@ import { Query } from "@topcoder-framework/client-relational"; class SubmissionQueryHelper { - public getChallengeProperties(challengeId: number, userId: number, resourceRoleId: string, phaseId: string): Query { + public getChallengeProperties(challengeId: number, userId: number, resourceRoleId: string, phaseId: number): Query { return { query: { $case: "raw", @@ -11,7 +11,7 @@ class SubmissionQueryHelper { where p.project_category_id = pcl.project_category_id and p.project_id = r.project_id and r.user_id = ${userId} and r.resource_role_id = ${resourceRoleId} and p.project_id = pp.project_id and pp.project_phase_id = ${phaseId} and p.project_id = pi28.project_id - and pi28.project_info_type_id = 28 and p.project_id = ${challengeId}`, + and pi28.project_info_type_id = 28 and p.project_id =${challengeId}`, }, }, }; diff --git a/src/models/domain-layer/legacy/resource_submission.ts b/src/models/domain-layer/legacy/resource_submission.ts index 39b8062..ffddf57 100644 --- a/src/models/domain-layer/legacy/resource_submission.ts +++ b/src/models/domain-layer/legacy/resource_submission.ts @@ -14,6 +14,10 @@ export interface ResourceSubmission { export interface CreateResourceSubmissionInput { resourceId?: number | undefined; submissionId: number; + createUser: number; + createDate: string; + modifyUser: number; + modifyDate: string; } function createBaseResourceSubmission(): ResourceSubmission { @@ -115,7 +119,7 @@ export const ResourceSubmission = { }; function createBaseCreateResourceSubmissionInput(): CreateResourceSubmissionInput { - return { resourceId: undefined, submissionId: 0 }; + return { resourceId: undefined, submissionId: 0, createUser: 0, createDate: "", modifyUser: 0, modifyDate: "" }; } export const CreateResourceSubmissionInput = { @@ -126,6 +130,18 @@ export const CreateResourceSubmissionInput = { if (message.submissionId !== 0) { writer.uint32(16).int32(message.submissionId); } + if (message.createUser !== 0) { + writer.uint32(24).int32(message.createUser); + } + if (message.createDate !== "") { + writer.uint32(34).string(message.createDate); + } + if (message.modifyUser !== 0) { + writer.uint32(40).int32(message.modifyUser); + } + if (message.modifyDate !== "") { + writer.uint32(50).string(message.modifyDate); + } return writer; }, @@ -142,6 +158,18 @@ export const CreateResourceSubmissionInput = { case 2: message.submissionId = reader.int32(); break; + case 3: + message.createUser = reader.int32(); + break; + case 4: + message.createDate = reader.string(); + break; + case 5: + message.modifyUser = reader.int32(); + break; + case 6: + message.modifyDate = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -154,6 +182,10 @@ export const CreateResourceSubmissionInput = { return { resourceId: isSet(object.resourceId) ? Number(object.resourceId) : undefined, submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + createDate: isSet(object.createDate) ? String(object.createDate) : "", + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + modifyDate: isSet(object.modifyDate) ? String(object.modifyDate) : "", }; }, @@ -161,6 +193,10 @@ export const CreateResourceSubmissionInput = { const obj: any = {}; message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); message.submissionId !== undefined && (obj.submissionId = Math.round(message.submissionId)); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.createDate !== undefined && (obj.createDate = message.createDate); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.modifyDate !== undefined && (obj.modifyDate = message.modifyDate); return obj; }, @@ -174,6 +210,10 @@ export const CreateResourceSubmissionInput = { const message = createBaseCreateResourceSubmissionInput(); message.resourceId = object.resourceId ?? undefined; message.submissionId = object.submissionId ?? 0; + message.createUser = object.createUser ?? 0; + message.createDate = object.createDate ?? ""; + message.modifyUser = object.modifyUser ?? 0; + message.modifyDate = object.modifyDate ?? ""; return message; }, }; diff --git a/src/models/domain-layer/legacy/services/submission.ts b/src/models/domain-layer/legacy/services/submission.ts index 44caca1..8774578 100644 --- a/src/models/domain-layer/legacy/services/submission.ts +++ b/src/models/domain-layer/legacy/services/submission.ts @@ -3,12 +3,19 @@ import { handleUnaryCall, UntypedServiceImplementation } from "@grpc/grpc-js"; import { CheckExistsResult, CreateResult, + Empty, LookupCriteria, ScanRequest, ScanResult, UpdateResult, } from "@topcoder-framework/lib-common"; -import { CreateSubmissionInput, LegacySubmission, LegacySubmissionId, UpdateSubmissionInput } from "../submission"; +import { + CreateSubmissionInput, + DeleteChallengeSubmissionInput, + LegacySubmission, + LegacySubmissionId, + UpdateSubmissionInput, +} from "../submission"; export type LegacySubmissionService = typeof LegacySubmissionService; export const LegacySubmissionService = { @@ -57,6 +64,16 @@ export const LegacySubmissionService = { responseSerialize: (value: UpdateResult) => Buffer.from(UpdateResult.encode(value).finish()), responseDeserialize: (value: Buffer) => UpdateResult.decode(value), }, + deleteChallengeSubmission: { + path: "/topcoder.domain.service.legacy_submission.LegacySubmission/DeleteChallengeSubmission", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteChallengeSubmissionInput) => + Buffer.from(DeleteChallengeSubmissionInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteChallengeSubmissionInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, } as const; export interface LegacySubmissionServer extends UntypedServiceImplementation { @@ -65,4 +82,5 @@ export interface LegacySubmissionServer extends UntypedServiceImplementation { lookup: handleUnaryCall; create: handleUnaryCall; update: handleUnaryCall; + deleteChallengeSubmission: handleUnaryCall; } diff --git a/src/models/domain-layer/legacy/services/upload.ts b/src/models/domain-layer/legacy/services/upload.ts index ffc6a31..9dab35e 100644 --- a/src/models/domain-layer/legacy/services/upload.ts +++ b/src/models/domain-layer/legacy/services/upload.ts @@ -8,7 +8,7 @@ import { ScanResult, UpdateResult, } from "@topcoder-framework/lib-common"; -import { CreateUploadInput, UpdateUploadInput, Upload } from "../upload"; +import { CreateUploadInput, DeleteSubmissionUploadInput, UpdateUploadInput, Upload } from "../upload"; export type LegacyUploadService = typeof LegacyUploadService; export const LegacyUploadService = { @@ -57,6 +57,16 @@ export const LegacyUploadService = { responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), responseDeserialize: (value: Buffer) => Empty.decode(value), }, + deleteSubmissionUploadInput: { + path: "/topcoder.domain.service.legacy_upload.LegacyUpload/DeleteSubmissionUploadInput", + requestStream: false, + responseStream: false, + requestSerialize: (value: DeleteSubmissionUploadInput) => + Buffer.from(DeleteSubmissionUploadInput.encode(value).finish()), + requestDeserialize: (value: Buffer) => DeleteSubmissionUploadInput.decode(value), + responseSerialize: (value: Empty) => Buffer.from(Empty.encode(value).finish()), + responseDeserialize: (value: Buffer) => Empty.decode(value), + }, } as const; export interface LegacyUploadServer extends UntypedServiceImplementation { @@ -65,4 +75,5 @@ export interface LegacyUploadServer extends UntypedServiceImplementation { create: handleUnaryCall; update: handleUnaryCall; delete: handleUnaryCall; + deleteSubmissionUploadInput: handleUnaryCall; } diff --git a/src/models/domain-layer/legacy/submission.ts b/src/models/domain-layer/legacy/submission.ts index 29ef181..ceb86f5 100644 --- a/src/models/domain-layer/legacy/submission.ts +++ b/src/models/domain-layer/legacy/submission.ts @@ -24,14 +24,14 @@ export interface CreateSubmissionInput { challengeId: string; created: number; fileType: string; - legacyChallengeId?: number | undefined; + legacyChallengeId: number; memberId: number; - submissionPhaseId: string; + submissionPhaseId: number; submittedDate?: number | undefined; type: string; updated?: number | undefined; updatedBy?: string | undefined; - url?: string | undefined; + url: string; legacyUploadId?: number | undefined; v5ChallengeId?: string | undefined; } @@ -46,6 +46,11 @@ export interface UpdateSubmissionInput { finalScore?: number | undefined; } +export interface DeleteChallengeSubmissionInput { + challengeId: number; + resourceId: number; +} + function createBaseLegacySubmission(): LegacySubmission { return { submissionId: 0, @@ -257,14 +262,14 @@ function createBaseCreateSubmissionInput(): CreateSubmissionInput { challengeId: "", created: 0, fileType: "", - legacyChallengeId: undefined, + legacyChallengeId: 0, memberId: 0, - submissionPhaseId: "", + submissionPhaseId: 0, submittedDate: undefined, type: "", updated: undefined, updatedBy: undefined, - url: undefined, + url: "", legacyUploadId: undefined, v5ChallengeId: undefined, }; @@ -281,14 +286,14 @@ export const CreateSubmissionInput = { if (message.fileType !== "") { writer.uint32(50).string(message.fileType); } - if (message.legacyChallengeId !== undefined) { + if (message.legacyChallengeId !== 0) { writer.uint32(56).int64(message.legacyChallengeId); } if (message.memberId !== 0) { writer.uint32(64).int64(message.memberId); } - if (message.submissionPhaseId !== "") { - writer.uint32(74).string(message.submissionPhaseId); + if (message.submissionPhaseId !== 0) { + writer.uint32(72).int32(message.submissionPhaseId); } if (message.submittedDate !== undefined) { writer.uint32(80).int64(message.submittedDate); @@ -302,7 +307,7 @@ export const CreateSubmissionInput = { if (message.updatedBy !== undefined) { writer.uint32(106).string(message.updatedBy); } - if (message.url !== undefined) { + if (message.url !== "") { writer.uint32(114).string(message.url); } if (message.legacyUploadId !== undefined) { @@ -337,7 +342,7 @@ export const CreateSubmissionInput = { message.memberId = longToNumber(reader.int64() as Long); break; case 9: - message.submissionPhaseId = reader.string(); + message.submissionPhaseId = reader.int32(); break; case 10: message.submittedDate = longToNumber(reader.int64() as Long); @@ -373,14 +378,14 @@ export const CreateSubmissionInput = { challengeId: isSet(object.challengeId) ? String(object.challengeId) : "", created: isSet(object.created) ? Number(object.created) : 0, fileType: isSet(object.fileType) ? String(object.fileType) : "", - legacyChallengeId: isSet(object.legacyChallengeId) ? Number(object.legacyChallengeId) : undefined, + legacyChallengeId: isSet(object.legacyChallengeId) ? Number(object.legacyChallengeId) : 0, memberId: isSet(object.memberId) ? Number(object.memberId) : 0, - submissionPhaseId: isSet(object.submissionPhaseId) ? String(object.submissionPhaseId) : "", + submissionPhaseId: isSet(object.submissionPhaseId) ? Number(object.submissionPhaseId) : 0, submittedDate: isSet(object.submittedDate) ? Number(object.submittedDate) : undefined, type: isSet(object.type) ? String(object.type) : "", updated: isSet(object.updated) ? Number(object.updated) : undefined, updatedBy: isSet(object.updatedBy) ? String(object.updatedBy) : undefined, - url: isSet(object.url) ? String(object.url) : undefined, + url: isSet(object.url) ? String(object.url) : "", legacyUploadId: isSet(object.legacyUploadId) ? Number(object.legacyUploadId) : undefined, v5ChallengeId: isSet(object.v5ChallengeId) ? String(object.v5ChallengeId) : undefined, }; @@ -393,7 +398,7 @@ export const CreateSubmissionInput = { message.fileType !== undefined && (obj.fileType = message.fileType); message.legacyChallengeId !== undefined && (obj.legacyChallengeId = Math.round(message.legacyChallengeId)); message.memberId !== undefined && (obj.memberId = Math.round(message.memberId)); - message.submissionPhaseId !== undefined && (obj.submissionPhaseId = message.submissionPhaseId); + message.submissionPhaseId !== undefined && (obj.submissionPhaseId = Math.round(message.submissionPhaseId)); message.submittedDate !== undefined && (obj.submittedDate = Math.round(message.submittedDate)); message.type !== undefined && (obj.type = message.type); message.updated !== undefined && (obj.updated = Math.round(message.updated)); @@ -413,14 +418,14 @@ export const CreateSubmissionInput = { message.challengeId = object.challengeId ?? ""; message.created = object.created ?? 0; message.fileType = object.fileType ?? ""; - message.legacyChallengeId = object.legacyChallengeId ?? undefined; + message.legacyChallengeId = object.legacyChallengeId ?? 0; message.memberId = object.memberId ?? 0; - message.submissionPhaseId = object.submissionPhaseId ?? ""; + message.submissionPhaseId = object.submissionPhaseId ?? 0; message.submittedDate = object.submittedDate ?? undefined; message.type = object.type ?? ""; message.updated = object.updated ?? undefined; message.updatedBy = object.updatedBy ?? undefined; - message.url = object.url ?? undefined; + message.url = object.url ?? ""; message.legacyUploadId = object.legacyUploadId ?? undefined; message.v5ChallengeId = object.v5ChallengeId ?? undefined; return message; @@ -542,6 +547,70 @@ export const UpdateSubmissionInput = { }, }; +function createBaseDeleteChallengeSubmissionInput(): DeleteChallengeSubmissionInput { + return { challengeId: 0, resourceId: 0 }; +} + +export const DeleteChallengeSubmissionInput = { + encode(message: DeleteChallengeSubmissionInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.challengeId !== 0) { + writer.uint32(8).int32(message.challengeId); + } + if (message.resourceId !== 0) { + writer.uint32(16).int32(message.resourceId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteChallengeSubmissionInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteChallengeSubmissionInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.challengeId = reader.int32(); + break; + case 2: + message.resourceId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteChallengeSubmissionInput { + return { + challengeId: isSet(object.challengeId) ? Number(object.challengeId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + }; + }, + + toJSON(message: DeleteChallengeSubmissionInput): unknown { + const obj: any = {}; + message.challengeId !== undefined && (obj.challengeId = Math.round(message.challengeId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + return obj; + }, + + create, I>>(base?: I): DeleteChallengeSubmissionInput { + return DeleteChallengeSubmissionInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): DeleteChallengeSubmissionInput { + const message = createBaseDeleteChallengeSubmissionInput(); + message.challengeId = object.challengeId ?? 0; + message.resourceId = object.resourceId ?? 0; + return message; + }, +}; + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/models/domain-layer/legacy/upload.ts b/src/models/domain-layer/legacy/upload.ts index ab07695..f83a852 100644 --- a/src/models/domain-layer/legacy/upload.ts +++ b/src/models/domain-layer/legacy/upload.ts @@ -33,6 +33,11 @@ export interface CreateUploadInput { url: string; uploadStatusId: number; parameter: string; + /** Missing 8 */ + createUser: number; + modifyUser: number; + createDate: string; + modifyDate: string; } export interface UpdateUploadInput { @@ -45,6 +50,12 @@ export interface DeleteUploadInput { filterCriteria: ScanCriteria[]; } +export interface DeleteSubmissionUploadInput { + challengeId: number; + resourceId: number; + uploadId: number; +} + function createBaseUpload(): Upload { return { uploadId: 0, @@ -317,7 +328,19 @@ export const UploadList = { }; function createBaseCreateUploadInput(): CreateUploadInput { - return { projectId: 0, resourceId: 0, projectPhaseId: 0, uploadTypeId: 0, url: "", uploadStatusId: 0, parameter: "" }; + return { + projectId: 0, + resourceId: 0, + projectPhaseId: 0, + uploadTypeId: 0, + url: "", + uploadStatusId: 0, + parameter: "", + createUser: 0, + modifyUser: 0, + createDate: "", + modifyDate: "", + }; } export const CreateUploadInput = { @@ -343,6 +366,18 @@ export const CreateUploadInput = { if (message.parameter !== "") { writer.uint32(58).string(message.parameter); } + if (message.createUser !== 0) { + writer.uint32(72).int32(message.createUser); + } + if (message.modifyUser !== 0) { + writer.uint32(80).int32(message.modifyUser); + } + if (message.createDate !== "") { + writer.uint32(90).string(message.createDate); + } + if (message.modifyDate !== "") { + writer.uint32(98).string(message.modifyDate); + } return writer; }, @@ -374,6 +409,18 @@ export const CreateUploadInput = { case 7: message.parameter = reader.string(); break; + case 9: + message.createUser = reader.int32(); + break; + case 10: + message.modifyUser = reader.int32(); + break; + case 11: + message.createDate = reader.string(); + break; + case 12: + message.modifyDate = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -391,6 +438,10 @@ export const CreateUploadInput = { url: isSet(object.url) ? String(object.url) : "", uploadStatusId: isSet(object.uploadStatusId) ? Number(object.uploadStatusId) : 0, parameter: isSet(object.parameter) ? String(object.parameter) : "", + createUser: isSet(object.createUser) ? Number(object.createUser) : 0, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, + createDate: isSet(object.createDate) ? String(object.createDate) : "", + modifyDate: isSet(object.modifyDate) ? String(object.modifyDate) : "", }; }, @@ -403,6 +454,10 @@ export const CreateUploadInput = { message.url !== undefined && (obj.url = message.url); message.uploadStatusId !== undefined && (obj.uploadStatusId = Math.round(message.uploadStatusId)); message.parameter !== undefined && (obj.parameter = message.parameter); + message.createUser !== undefined && (obj.createUser = Math.round(message.createUser)); + message.modifyUser !== undefined && (obj.modifyUser = Math.round(message.modifyUser)); + message.createDate !== undefined && (obj.createDate = message.createDate); + message.modifyDate !== undefined && (obj.modifyDate = message.modifyDate); return obj; }, @@ -419,6 +474,10 @@ export const CreateUploadInput = { message.url = object.url ?? ""; message.uploadStatusId = object.uploadStatusId ?? 0; message.parameter = object.parameter ?? ""; + message.createUser = object.createUser ?? 0; + message.modifyUser = object.modifyUser ?? 0; + message.createDate = object.createDate ?? ""; + message.modifyDate = object.modifyDate ?? ""; return message; }, }; @@ -553,6 +612,77 @@ export const DeleteUploadInput = { }, }; +function createBaseDeleteSubmissionUploadInput(): DeleteSubmissionUploadInput { + return { challengeId: 0, resourceId: 0, uploadId: 0 }; +} + +export const DeleteSubmissionUploadInput = { + encode(message: DeleteSubmissionUploadInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.challengeId !== 0) { + writer.uint32(8).int32(message.challengeId); + } + if (message.resourceId !== 0) { + writer.uint32(16).int32(message.resourceId); + } + if (message.uploadId !== 0) { + writer.uint32(24).int32(message.uploadId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DeleteSubmissionUploadInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDeleteSubmissionUploadInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.challengeId = reader.int32(); + break; + case 2: + message.resourceId = reader.int32(); + break; + case 3: + message.uploadId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DeleteSubmissionUploadInput { + return { + challengeId: isSet(object.challengeId) ? Number(object.challengeId) : 0, + resourceId: isSet(object.resourceId) ? Number(object.resourceId) : 0, + uploadId: isSet(object.uploadId) ? Number(object.uploadId) : 0, + }; + }, + + toJSON(message: DeleteSubmissionUploadInput): unknown { + const obj: any = {}; + message.challengeId !== undefined && (obj.challengeId = Math.round(message.challengeId)); + message.resourceId !== undefined && (obj.resourceId = Math.round(message.resourceId)); + message.uploadId !== undefined && (obj.uploadId = Math.round(message.uploadId)); + return obj; + }, + + create, I>>(base?: I): DeleteSubmissionUploadInput { + return DeleteSubmissionUploadInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): DeleteSubmissionUploadInput { + const message = createBaseDeleteSubmissionUploadInput(); + message.challengeId = object.challengeId ?? 0; + message.resourceId = object.resourceId ?? 0; + message.uploadId = object.uploadId ?? 0; + return message; + }, +}; + type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; type DeepPartial = T extends Builtin ? T diff --git a/yarn.lock b/yarn.lock index 6f424e1..bac80e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1899,6 +1899,13 @@ mkdirp@^1.0.4: resolved "http://localhost:4873/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== +moment-timezone@^0.5.41: + version "0.5.41" + resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.41.tgz#a7ad3285fd24aaf5f93b8119a9d749c8039c64c5" + integrity sha512-e0jGNZDOHfBXJGz8vR/sIMXvBIGJJcqFjmlg9lmE+5KX1U7/RZNMswfD8nKnNCnQdKTIj50IaRKwl1fvMLyyRg== + dependencies: + moment "^2.29.4" + moment@^2.29.4: version "2.29.4" resolved "http://localhost:4873/moment/-/moment-2.29.4.tgz#3dbe052889fe7c1b2ed966fcb3a77328964ef108" From 5f3783f0daf486ba0d2dcd4bbaa313ae89245c67 Mon Sep 17 00:00:00 2001 From: Hamid Tavakoli Date: Thu, 16 Mar 2023 02:41:53 -0600 Subject: [PATCH 8/8] feat: submission create done for mm and regular --- src/domain/LegacyResourceSubmission.ts | 26 +- src/domain/LegacySubmission.ts | 350 ++++++++++++++++-- .../legacy/resource_submission.ts | 41 +- src/models/domain-layer/legacy/submission.ts | 166 +++++++++ src/service/LegacySubmission.ts | 13 +- src/service/LegacyUpload.ts | 33 +- 6 files changed, 547 insertions(+), 82 deletions(-) diff --git a/src/domain/LegacyResourceSubmission.ts b/src/domain/LegacyResourceSubmission.ts index 7e3c089..faf3e3f 100644 --- a/src/domain/LegacyResourceSubmission.ts +++ b/src/domain/LegacyResourceSubmission.ts @@ -1,22 +1,22 @@ -import {QueryBuilder} from '@topcoder-framework/client-relational'; +import { QueryBuilder } from '@topcoder-framework/client-relational'; -import {queryRunner} from '../helper/QueryRunner'; -import {CreateResourceSubmissionInput} from '../models/domain-layer/legacy/resource_submission'; -import {ResourceSubmissionSchema} from '../schema/resource/ResourceSubmission'; +import { queryRunner } from '../helper/QueryRunner'; +import { CreateResourceSubmissionInput } from '../models/domain-layer/legacy/resource_submission'; +import { ResourceSubmissionSchema } from '../schema/resource/ResourceSubmission'; class LegacyResourceSubmissionDomain { public async create(input: CreateResourceSubmissionInput): Promise { const query = new QueryBuilder(ResourceSubmissionSchema) - .insert({ - submission_id: input.submissionId, - resource_id: input.resourceId, - create_date: input.createDate, - update_date: input.updateDate, - create_user: input.createUser, - modeify_user: input.modifyUser - }) - .build(); + .insert({ + submission_id: input.submissionId, + resource_id: input.resourceId, + create_date: input.createDate as string, + update_date: input.modifyDate as string, + create_user: input.createUser as number, + modify_user: input.modifyUser as number, + }) + .build(); await queryRunner.run(query); return true; } diff --git a/src/domain/LegacySubmission.ts b/src/domain/LegacySubmission.ts index 7f1df34..601e4e6 100644 --- a/src/domain/LegacySubmission.ts +++ b/src/domain/LegacySubmission.ts @@ -1,12 +1,20 @@ -import { ColumnType, Operator, Query, QueryBuilder, QueryRequest, QueryResult } from '@topcoder-framework/client-relational'; +import _ from 'lodash'; +import { + ColumnType, Operator, Query, QueryBuilder, + QueryRequest, QueryResult +} from '@topcoder-framework/client-relational'; import { CheckExistsResult, CreateResult, UpdateResult } from '@topcoder-framework/lib-common'; +import moment from 'moment'; import momentTZ from 'moment-timezone'; - import { Util } from '../common/Util'; import { TIME_ZONE } from '../config'; import SubmissionQueryHelper from '../helper/query-helper/SubmissionQueryHelper'; import { queryRunner } from '../helper/QueryRunner'; -import { CreateSubmissionInput, DeleteChallengeSubmissionInput, LegacySubmissionId, UpdateSubmissionInput } from '../models/domain-layer/legacy/submission'; +import { + CreateSubmissionInput, DeleteChallengeSubmissionInput, + GetMMChallengePropertiesInput, LegacySubmissionId, + MMChallengeProperties, UpdateSubmissionInput +} from '../models/domain-layer/legacy/submission'; import { LegacySubmissionSchema } from '../schema/submission/Submission'; import LegacyResourceSubmissionDomain from './LegacyResourceSubmission'; @@ -47,6 +55,16 @@ const UPLOAD_STATUS = { 'Deleted': 2 } + +const COMPONENT_STATE = { + // could add more from https://github.com/appirio-tech/tc1-tcnode/blob/master/tc-common/src/main/java/com/topcoder/web/common/model/algo/ComponentState.java + ACTIVE: 100, + NOT_CHALLENGED: 130 // Submitted +} + +const LANGUAGE = { + OTHERS: 9 +} class LegacySubmissionDomain { public async checkSubmissionExists({ legacySubmissionId }: LegacySubmissionId): Promise { @@ -81,7 +99,6 @@ class LegacySubmissionDomain { input.legacyChallengeId, input.memberId, subRoleId, input.submissionPhaseId); - // TODO: We do not need this but check const { rows } = await queryRunner.run(challengePropertiesQuery); if (!rows || rows.length === 0) return Promise.reject('Error') @@ -109,7 +126,7 @@ class LegacySubmissionDomain { projectId: input.legacyChallengeId, projectPhaseId: input.submissionPhaseId, resourceId: resourceId, - uploadTypeId: uploadType, + uploadTypeId: uploadType, //TODO: This does not look right url: input.url, parameter: 'N/A', uploadStatusId: UPLOAD_STATUS.Active, @@ -119,54 +136,280 @@ class LegacySubmissionDomain { return Promise.reject('Error') } const uploadId = uploadResult.kind.integerId - const insertSubmissionQuery = - new QueryBuilder(LegacySubmissionSchema) - .insert({ - uploadId, - submission_status_id: submissionStatus.Active, - // eslint-disable-next-line - submission_type_id: (submissionTypes as any)[input.type].id, - ...audits + if (uploadType === uploadTypes['Final Fix']) { + return Promise.resolve({ + kind: { + $case: 'stringId', + stringId: uploadId.toString(), + }, + }); + } else { + const insertSubmissionQuery = + new QueryBuilder(LegacySubmissionSchema) + .insert({ + uploadId, + submission_status_id: submissionStatus.Active, + // eslint-disable-next-line + submission_type_id: (submissionTypes as any)[input.type].id, + ...audits + }) + .build(); + + + + const { lastInsertId }: QueryResult = + await queryRunner.run(insertSubmissionQuery); + + + if (!lastInsertId) { + return Promise.reject('Error while creating submission') + } + await LegacyResourceSubmissionDomain.create({ + submissionId: lastInsertId, + resourceId: (resourceId as number), + ...audits + }); + + if (!isAllowMultipleSubmission) { + await LegacyUploadDomain + .deleteSubmissionUpload({ + uploadId, + challengeId: input.legacyChallengeId, + resourceId: (resourceId as number), + }) + + await this.deleteChallengeSubmission({ + challengeId: input.legacyChallengeId, + resourceId: (resourceId as number), }) - .build(); + } + return Promise.resolve({ + kind: { + $case: 'integerId', + integerId: lastInsertId, + }, + }); + } + } - const { lastInsertId }: QueryResult = - await queryRunner.run(insertSubmissionQuery); + public async createMMSubmission(input: CreateSubmissionInput): Promise { + // eslint-disable-next-line + const subRoleId: string | undefined = (submissionTypes as any)[input.type] ? + (submissionTypes as any)[input.type].roleId : + undefined; + if (!subRoleId) return Promise.reject('Invalid submission type') + const challengePropertiesQuery = + SubmissionQueryHelper.getChallengeProperties( + input.legacyChallengeId, input.memberId, subRoleId, + input.submissionPhaseId); - if (!lastInsertId) { - return Promise.reject('Error while creating submission') + const { rows } = await queryRunner.run(challengePropertiesQuery); + + if (!rows || rows.length === 0) return Promise.reject('Error') + + const { resourceId, phaseTypeId, value, challengeTypeId } = rows[0]; + const uploadType = phaseTypeId === phaseTypes['Final Fix'] ? + uploadTypes['Final Fix'] : + uploadTypes.Submission; + + let isAllowMultipleSubmission = true; + + if (challengeTypeId === CHALLENGE_TYPE['Studio'] || value === 'true') { + isAllowMultipleSubmission = true; } - await LegacyResourceSubmissionDomain.create({ - submissionId: lastInsertId, - resourceId: (resourceId as number), + const audits = { + createUser: input.memberId, + createDate: + momentTZ.tz(input.created, TIME_ZONE).format('YYYY-MM-DD HH:mm:ss'), + modifyUser: input.memberId, + modifyDate: + momentTZ.tz(input.created, TIME_ZONE).format('YYYY-MM-DD HH:mm:ss') + } + + const uploadResult = await LegacyUploadDomain.create({ + projectId: input.legacyChallengeId, + projectPhaseId: input.submissionPhaseId, + resourceId: resourceId, + uploadTypeId: uploadType,//TODO: This does not look right + url: input.url, + parameter: 'N/A', + uploadStatusId: UPLOAD_STATUS.Active, ...audits }); + if (!uploadResult.kind || uploadResult.kind.$case !== 'integerId') { + return Promise.reject('Error') + } + const uploadId = uploadResult.kind.integerId + if (uploadType === uploadTypes['Final Fix']) { + return Promise.resolve({ + kind: { + $case: 'stringId', + stringId: uploadId.toString(), + }, + }); + } else { + + const insertSubmissionQuery = + new QueryBuilder(LegacySubmissionSchema) + .insert({ + uploadId, + submission_status_id: submissionStatus.Active, + // eslint-disable-next-line + submission_type_id: (submissionTypes as any)[input.type].id, + ...audits + }) + .build(); - if (!isAllowMultipleSubmission) { - await LegacyUploadDomain - .deleteSubmissionUpload({ - uploadId, + + + const { lastInsertId }: QueryResult = + await queryRunner.run(insertSubmissionQuery); + + + if (!lastInsertId) { + return Promise.reject('Error while creating submission') + } + await LegacyResourceSubmissionDomain.create({ + submissionId: lastInsertId, + resourceId: (resourceId as number), + ...audits + }); + + if (!isAllowMultipleSubmission) { + await LegacyUploadDomain + .deleteSubmissionUpload({ + uploadId, + challengeId: input.legacyChallengeId, + resourceId: (resourceId as number), + }) + + await this.deleteChallengeSubmission({ challengeId: input.legacyChallengeId, resourceId: (resourceId as number), }) - - await this.deleteChallengeSubmission({ + } + + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + const { roundId, + componentId, + componentStateId, + numSubmissions, + points + } = await this.getMMChallengeProperties({ challengeId: input.legacyChallengeId, - resourceId: (resourceId as number), - }) - } + userId: input.memberId, + }); + const { rows: rrResultRows } = await queryRunner.run({ + query: { + $case: 'raw', + raw: { + query: `select rr.round_id, rr.coder_id from + informixoltp:round_registration rr where + rr.round_id=${roundId as number} and rr.coder_id=${input.memberId}` + }, + }, + }) + if (!rrResultRows || rrResultRows.length === 0) { + const rrParams = { + roundId: roundId as number, + userId: input.memberId, + timestamp: moment(input.created).format('YYYY-MM-DD HH:mm:ss'), + eligible: 1, + teamId: { + replace: 'null', + }, + }; + + await queryRunner.run({ + query: { + $case: 'raw', + raw: { + query: ` + insert into informixoltp:round_registration (round_id, coder_id, + timestamp, eligible, team_id) + values(${rrParams.roundId}, ${rrParams.userId}, + ${rrParams.timestamp}, ${rrParams.eligible}, null)` + }, + }, + }) + } + let submissionCounter = numSubmissions as number; + if (_.isFinite(componentId)) { + submissionCounter += 1; + await queryRunner.run({ + query: { + $case: 'raw', + raw: { + query: `update informixoltp:long_component_state set submission_number=${submissionCounter} + where long_component_state_id=${componentStateId as number}` + }, + }, + }) + } else { + submissionCounter = 1; + const lcsParams = { + componentStateId: componentStateId as number, + roundId: roundId as number, + componentId: componentId as number, + userId: input.memberId, + points: 0, + statusId: COMPONENT_STATE.ACTIVE, + numSubmissions: submissionCounter, + numExampleSubmissions: 0, + }; + await queryRunner.run({ + query: { + $case: 'raw', + raw: { + query: ` + insert into informixoltp:long_component_state + (long_component_state_id, round_id, coder_id, component_id, points, + status_id, submission_number, example_submission_number) + values(${lcsParams.componentStateId}, ${lcsParams.roundId}, ${lcsParams.userId}, + ${lcsParams.componentId},${lcsParams.points},${lcsParams.statusId}, + ${lcsParams.numSubmissions}, ${lcsParams.numExampleSubmissions})` + }, + }, + }) + } - return Promise.resolve({ - kind: { - $case: 'integerId', - integerId: lastInsertId, - }, - }); + const lsParams = { + componentStateId: componentStateId as number, + numSubmissions: submissionCounter, + submissionText: { + replace: 'null', + }, + openTime: input.created, + submitTime: input.created, + submissionPoints: points as number, + languageId: LANGUAGE.OTHERS, + isExample: 0, + }; + + await queryRunner.run({ + query: { + $case: 'raw', + raw: { + query: `insert into informixoltp:long_submission(long_component_state_id, submission_number, + submission_text, open_time, submit_time, submission_points, language_id, example) + values(${lsParams.componentStateId}, ${lsParams.numSubmissions}, + ${JSON.stringify(lsParams.submissionText)}, ${lsParams.openTime}, ${lsParams.submitTime}, + ${lsParams.submissionPoints},${lsParams.languageId}, ${lsParams.isExample})` + }, + }, + }) + return Promise.resolve({ + kind: { + $case: 'integerId', + integerId: lastInsertId, + }, + }); + } } public async listAvailableSubmissionInfoTypes(key: string): Promise { @@ -229,11 +472,40 @@ class LegacySubmissionDomain { $case: 'raw', raw: { query: `update submission set submission_status_id =${submissionStatus['Deleted']} - where upload_id in (select upload_id from upload where project_id=${input.challengeId} and resource_id=${input.resourceId} - and upload_status_id=${UPLOAD_STATUS['Deleted']})`, + where upload_id in (select upload_id from upload where project_id = ${input.challengeId} and resource_id = ${input.resourceId} + and upload_status_id = ${UPLOAD_STATUS['Deleted']})`, }, }, }) } - export default new LegacySubmissionDomain(); + private async getMMChallengeProperties(input: GetMMChallengePropertiesInput): Promise { + const { rows } = await queryRunner.run({ + query: { + $case: 'raw', + raw: { + query: `select rc.round_id, rc.component_id, lcs.long_component_state_id, NVL(lcs.submission_number, 0) as submission_number, NVL(lcs.points, 0) as points, r.rated_ind + from project p + join project_info pi56 on p.project_id = ${input.challengeId as number} and p.project_id = pi56.project_id and pi56.project_info_type_id = 56 and p.project_category_id = 37 + join informixoltp:round_component rc on rc.round_id = pi56.value + join informixoltp:round r on rc.round_id = r.round_id + left join informixoltp:long_component_state lcs on lcs.coder_id = ${input.userId as number}and lcs.round_id = rc.round_id and lcs.component_id = rc.component_id` + }, + }, + }) + if (!rows || rows.length === 0) return Promise.reject('Error') + const result = rows[0] + return { + roundId: result.round_id as number, + componentId: result.component_id as number, + componentStateId: result.long_component_state_id as number, + numSubmissions: result.submission_number as number, + points: result.points as number, + } + + } + + +} + +export default new LegacySubmissionDomain(); diff --git a/src/models/domain-layer/legacy/resource_submission.ts b/src/models/domain-layer/legacy/resource_submission.ts index ffddf57..105d68a 100644 --- a/src/models/domain-layer/legacy/resource_submission.ts +++ b/src/models/domain-layer/legacy/resource_submission.ts @@ -14,10 +14,10 @@ export interface ResourceSubmission { export interface CreateResourceSubmissionInput { resourceId?: number | undefined; submissionId: number; - createUser: number; - createDate: string; - modifyUser: number; - modifyDate: string; + createUser?: number | undefined; + createDate?: string | undefined; + modifyUser?: number | undefined; + modifyDate?: string | undefined; } function createBaseResourceSubmission(): ResourceSubmission { @@ -119,7 +119,14 @@ export const ResourceSubmission = { }; function createBaseCreateResourceSubmissionInput(): CreateResourceSubmissionInput { - return { resourceId: undefined, submissionId: 0, createUser: 0, createDate: "", modifyUser: 0, modifyDate: "" }; + return { + resourceId: undefined, + submissionId: 0, + createUser: undefined, + createDate: undefined, + modifyUser: undefined, + modifyDate: undefined, + }; } export const CreateResourceSubmissionInput = { @@ -130,16 +137,16 @@ export const CreateResourceSubmissionInput = { if (message.submissionId !== 0) { writer.uint32(16).int32(message.submissionId); } - if (message.createUser !== 0) { + if (message.createUser !== undefined) { writer.uint32(24).int32(message.createUser); } - if (message.createDate !== "") { + if (message.createDate !== undefined) { writer.uint32(34).string(message.createDate); } - if (message.modifyUser !== 0) { + if (message.modifyUser !== undefined) { writer.uint32(40).int32(message.modifyUser); } - if (message.modifyDate !== "") { + if (message.modifyDate !== undefined) { writer.uint32(50).string(message.modifyDate); } return writer; @@ -182,10 +189,10 @@ export const CreateResourceSubmissionInput = { return { resourceId: isSet(object.resourceId) ? Number(object.resourceId) : undefined, submissionId: isSet(object.submissionId) ? Number(object.submissionId) : 0, - createUser: isSet(object.createUser) ? Number(object.createUser) : 0, - createDate: isSet(object.createDate) ? String(object.createDate) : "", - modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : 0, - modifyDate: isSet(object.modifyDate) ? String(object.modifyDate) : "", + createUser: isSet(object.createUser) ? Number(object.createUser) : undefined, + createDate: isSet(object.createDate) ? String(object.createDate) : undefined, + modifyUser: isSet(object.modifyUser) ? Number(object.modifyUser) : undefined, + modifyDate: isSet(object.modifyDate) ? String(object.modifyDate) : undefined, }; }, @@ -210,10 +217,10 @@ export const CreateResourceSubmissionInput = { const message = createBaseCreateResourceSubmissionInput(); message.resourceId = object.resourceId ?? undefined; message.submissionId = object.submissionId ?? 0; - message.createUser = object.createUser ?? 0; - message.createDate = object.createDate ?? ""; - message.modifyUser = object.modifyUser ?? 0; - message.modifyDate = object.modifyDate ?? ""; + message.createUser = object.createUser ?? undefined; + message.createDate = object.createDate ?? undefined; + message.modifyUser = object.modifyUser ?? undefined; + message.modifyDate = object.modifyDate ?? undefined; return message; }, }; diff --git a/src/models/domain-layer/legacy/submission.ts b/src/models/domain-layer/legacy/submission.ts index ceb86f5..0dfa6da 100644 --- a/src/models/domain-layer/legacy/submission.ts +++ b/src/models/domain-layer/legacy/submission.ts @@ -51,6 +51,19 @@ export interface DeleteChallengeSubmissionInput { resourceId: number; } +export interface GetMMChallengePropertiesInput { + challengeId: number; + userId: number; +} + +export interface MMChallengeProperties { + roundId: number; + componentId: number; + componentStateId: number; + numSubmissions: number; + points: number; +} + function createBaseLegacySubmission(): LegacySubmission { return { submissionId: 0, @@ -611,6 +624,159 @@ export const DeleteChallengeSubmissionInput = { }, }; +function createBaseGetMMChallengePropertiesInput(): GetMMChallengePropertiesInput { + return { challengeId: 0, userId: 0 }; +} + +export const GetMMChallengePropertiesInput = { + encode(message: GetMMChallengePropertiesInput, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.challengeId !== 0) { + writer.uint32(8).int32(message.challengeId); + } + if (message.userId !== 0) { + writer.uint32(16).int32(message.userId); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GetMMChallengePropertiesInput { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetMMChallengePropertiesInput(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.challengeId = reader.int32(); + break; + case 2: + message.userId = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GetMMChallengePropertiesInput { + return { + challengeId: isSet(object.challengeId) ? Number(object.challengeId) : 0, + userId: isSet(object.userId) ? Number(object.userId) : 0, + }; + }, + + toJSON(message: GetMMChallengePropertiesInput): unknown { + const obj: any = {}; + message.challengeId !== undefined && (obj.challengeId = Math.round(message.challengeId)); + message.userId !== undefined && (obj.userId = Math.round(message.userId)); + return obj; + }, + + create, I>>(base?: I): GetMMChallengePropertiesInput { + return GetMMChallengePropertiesInput.fromPartial(base ?? {}); + }, + + fromPartial, I>>( + object: I, + ): GetMMChallengePropertiesInput { + const message = createBaseGetMMChallengePropertiesInput(); + message.challengeId = object.challengeId ?? 0; + message.userId = object.userId ?? 0; + return message; + }, +}; + +function createBaseMMChallengeProperties(): MMChallengeProperties { + return { roundId: 0, componentId: 0, componentStateId: 0, numSubmissions: 0, points: 0 }; +} + +export const MMChallengeProperties = { + encode(message: MMChallengeProperties, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer { + if (message.roundId !== 0) { + writer.uint32(8).int32(message.roundId); + } + if (message.componentId !== 0) { + writer.uint32(16).int32(message.componentId); + } + if (message.componentStateId !== 0) { + writer.uint32(24).int64(message.componentStateId); + } + if (message.numSubmissions !== 0) { + writer.uint32(32).int32(message.numSubmissions); + } + if (message.points !== 0) { + writer.uint32(40).int32(message.points); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MMChallengeProperties { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMMChallengeProperties(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.roundId = reader.int32(); + break; + case 2: + message.componentId = reader.int32(); + break; + case 3: + message.componentStateId = longToNumber(reader.int64() as Long); + break; + case 4: + message.numSubmissions = reader.int32(); + break; + case 5: + message.points = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MMChallengeProperties { + return { + roundId: isSet(object.roundId) ? Number(object.roundId) : 0, + componentId: isSet(object.componentId) ? Number(object.componentId) : 0, + componentStateId: isSet(object.componentStateId) ? Number(object.componentStateId) : 0, + numSubmissions: isSet(object.numSubmissions) ? Number(object.numSubmissions) : 0, + points: isSet(object.points) ? Number(object.points) : 0, + }; + }, + + toJSON(message: MMChallengeProperties): unknown { + const obj: any = {}; + message.roundId !== undefined && (obj.roundId = Math.round(message.roundId)); + message.componentId !== undefined && (obj.componentId = Math.round(message.componentId)); + message.componentStateId !== undefined && (obj.componentStateId = Math.round(message.componentStateId)); + message.numSubmissions !== undefined && (obj.numSubmissions = Math.round(message.numSubmissions)); + message.points !== undefined && (obj.points = Math.round(message.points)); + return obj; + }, + + create, I>>(base?: I): MMChallengeProperties { + return MMChallengeProperties.fromPartial(base ?? {}); + }, + + fromPartial, I>>(object: I): MMChallengeProperties { + const message = createBaseMMChallengeProperties(); + message.roundId = object.roundId ?? 0; + message.componentId = object.componentId ?? 0; + message.componentStateId = object.componentStateId ?? 0; + message.numSubmissions = object.numSubmissions ?? 0; + message.points = object.points ?? 0; + return message; + }, +}; + declare var self: any | undefined; declare var window: any | undefined; declare var global: any | undefined; diff --git a/src/service/LegacySubmission.ts b/src/service/LegacySubmission.ts index 379536e..5cb12c3 100644 --- a/src/service/LegacySubmission.ts +++ b/src/service/LegacySubmission.ts @@ -1,14 +1,14 @@ import { handleUnaryCall, sendUnaryData, ServerUnaryCall, UntypedHandleCall } from "@grpc/grpc-js"; import { CreateResult, LookupCriteria, - CheckExistsResult, UpdateResult, ScanResult, ScanRequest + CheckExistsResult, UpdateResult, ScanResult, ScanRequest, Empty } from "@topcoder-framework/lib-common"; import LegacySubmissionDomain from '../domain/LegacySubmission' import { LegacySubmissionService, LegacySubmissionServer } from '../models/domain-layer/legacy/services/submission'; import { CreateSubmissionInput, UpdateSubmissionInput, - LegacySubmission, LegacySubmissionId + LegacySubmission, LegacySubmissionId, DeleteChallengeSubmissionInput } from "../models/domain-layer/legacy/submission"; class LegacySubmissionServerImpl implements LegacySubmissionServer { @@ -54,6 +54,15 @@ class LegacySubmissionServerImpl implements LegacySubmissionServer { .then((response) => callback(null, response)) .catch((err) => callback(err, null)); }; + + deleteChallengeSubmission: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { + LegacySubmissionDomain.deleteChallengeSubmission(call.request) + .then(() => callback(null, null)) + .catch((err) => callback(err, null)); + }; } export { LegacySubmissionServerImpl as LegacySubmissionServer, LegacySubmissionService }; diff --git a/src/service/LegacyUpload.ts b/src/service/LegacyUpload.ts index fd71c8e..08cddd5 100644 --- a/src/service/LegacyUpload.ts +++ b/src/service/LegacyUpload.ts @@ -1,10 +1,14 @@ import { handleUnaryCall, sendUnaryData, ServerUnaryCall, UntypedHandleCall } from "@grpc/grpc-js"; -import { CreateResult, Empty, LookupCriteria, ScanRequest, ScanResult, UpdateResult +import { + CreateResult, Empty, LookupCriteria, ScanRequest, ScanResult, UpdateResult } from "@topcoder-framework/lib-common"; import LegacyUploadDomain from '../domain/LegacyUpload' import { LegacyUploadServer, LegacyUploadService } from '../models/domain-layer/legacy/services/upload'; -import { Upload, CreateUploadInput, DeleteUploadInput, UploadList, UpdateUploadInput } from "../models/domain-layer/legacy/upload"; +import { + Upload, CreateUploadInput, UpdateUploadInput, + DeleteSubmissionUploadInput +} from "../models/domain-layer/legacy/upload"; class LegacyUploadServerImpl implements LegacyUploadServer { [name: string]: UntypedHandleCall; @@ -17,12 +21,12 @@ class LegacyUploadServerImpl implements LegacyUploadServer { }; lookup: handleUnaryCall - = ( - call: ServerUnaryCall, - callback: sendUnaryData - ) => { - // not implemented - }; + = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { + // not implemented + }; create: handleUnaryCall = ( call: ServerUnaryCall, @@ -31,9 +35,9 @@ class LegacyUploadServerImpl implements LegacyUploadServer { // not implemented }; - delete: handleUnaryCall = ( - call: ServerUnaryCall, - callback: sendUnaryData + delete: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData ) => { // not implemented }; @@ -47,6 +51,13 @@ class LegacyUploadServerImpl implements LegacyUploadServer { .then((response) => callback(null, response)) .catch((err) => callback(err, null)); }; + + deleteSubmissionUploadInput: handleUnaryCall = ( + call: ServerUnaryCall, + callback: sendUnaryData + ) => { + // not implemented + }; } export { LegacyUploadServerImpl as LegacyUploadServer, LegacyUploadService };