diff --git a/frontend/components/incompleteupload/Editor.vue b/frontend/components/incompleteupload/Editor.vue new file mode 100644 index 0000000..365629d --- /dev/null +++ b/frontend/components/incompleteupload/Editor.vue @@ -0,0 +1,49 @@ + + + diff --git a/frontend/components/portfolio/Editor.vue b/frontend/components/portfolio/Editor.vue new file mode 100644 index 0000000..d06c02c --- /dev/null +++ b/frontend/components/portfolio/Editor.vue @@ -0,0 +1,49 @@ + + + diff --git a/frontend/composables/useTime.ts b/frontend/composables/useTime.ts index 466dda9..bb7a604 100644 --- a/frontend/composables/useTime.ts +++ b/frontend/composables/useTime.ts @@ -33,17 +33,9 @@ export const useTime = () => { }) } - const humanReadableDateLongFromStandardString = (s: string): ComputedRef => { - return humanReadableDateLong(new Date(Date.parse(s))) - } - - const humanReadableDateFromStandardString = (s: string): ComputedRef => { - return humanReadableDate(new Date(Date.parse(s))) - } - - const humanReadableTimeFromStandardString = (asStr: string): ComputedRef => { - return humanReadableTime(new Date(Date.parse(asStr))) - } + const humanReadableDateLongFromStandardString = (s: string): ComputedRef => humanReadableDateLong(new Date(Date.parse(s))) + const humanReadableDateFromStandardString = (s: string): ComputedRef => humanReadableDate(new Date(Date.parse(s))) + const humanReadableTimeFromStandardString = (asStr: string): ComputedRef => humanReadableTime(new Date(Date.parse(asStr))) const humanReadableTimeWithSeconds = (t: Date): ComputedRef => { return computed(() => { diff --git a/frontend/lib/editor/incomplete_upload.ts b/frontend/lib/editor/incomplete_upload.ts new file mode 100644 index 0000000..454400e --- /dev/null +++ b/frontend/lib/editor/incomplete_upload.ts @@ -0,0 +1,75 @@ +import { type IncompleteUpload } from '@/openapi/generated/pacta' +import { Validation, type EditorFieldsFor, type EditorComputedValues } from './common' +import { getEditorComputedValues } from './utils' + +export type EditorIncompleteUpload = EditorFieldsFor + +const createEditorIncompleteUpload = (incompleteUpload: IncompleteUpload): EditorIncompleteUpload => { + return { + id: { + name: 'id', + label: 'ID', + originalValue: incompleteUpload.id, + currentValue: incompleteUpload.id, + }, + name: { + name: 'name', + label: 'Name', + validation: [Validation.NotEmpty], + originalValue: incompleteUpload.name, + currentValue: incompleteUpload.name, + }, + description: { + name: 'description', + label: 'Description', + originalValue: incompleteUpload.description, + currentValue: incompleteUpload.description, + }, + adminDebugEnabled: { + name: 'adminDebugEnabled', + label: 'Admin Debugging Enabled', + originalValue: incompleteUpload.adminDebugEnabled, + currentValue: incompleteUpload.adminDebugEnabled, + }, + holdingsDate: { + name: 'holdingsDate', + label: 'Holdings Date', + originalValue: incompleteUpload.holdingsDate, + currentValue: incompleteUpload.holdingsDate, + }, + createdAt: { + name: 'createdAt', + label: 'Created At', + originalValue: incompleteUpload.createdAt, + currentValue: incompleteUpload.createdAt, + }, + ranAt: { + name: 'ranAt', + label: 'Ran At', + originalValue: incompleteUpload.ranAt, + currentValue: incompleteUpload.ranAt, + }, + completedAt: { + name: 'completedAt', + label: 'Completed At', + originalValue: incompleteUpload.completedAt, + currentValue: incompleteUpload.completedAt, + }, + failureMessage: { + name: 'failureMessage', + label: 'Failure Message', + originalValue: incompleteUpload.failureMessage, + currentValue: incompleteUpload.failureMessage, + }, + failureCode: { + name: 'failureCode', + label: 'Failure Code', + originalValue: incompleteUpload.failureCode, + currentValue: incompleteUpload.failureCode, + }, + } +} + +export const incompleteUploadEditor = (i: IncompleteUpload): EditorComputedValues => { + return getEditorComputedValues(`lib/editor/incompleteUpload[${i.id}]`, i, createEditorIncompleteUpload) +} diff --git a/frontend/lib/editor/index.ts b/frontend/lib/editor/index.ts index d859882..15b13ed 100644 --- a/frontend/lib/editor/index.ts +++ b/frontend/lib/editor/index.ts @@ -2,3 +2,5 @@ export * from './common' export * from './initiative' export * from './pacta_version' export * from './user' +export * from './incomplete_upload' +export * from './portfolio' diff --git a/frontend/lib/editor/portfolio.ts b/frontend/lib/editor/portfolio.ts new file mode 100644 index 0000000..c2eedc5 --- /dev/null +++ b/frontend/lib/editor/portfolio.ts @@ -0,0 +1,57 @@ +import { type Portfolio } from '@/openapi/generated/pacta' +import { Validation, type EditorFieldsFor, type EditorComputedValues } from './common' +import { getEditorComputedValues } from './utils' + +export type EditorPortfolio = EditorFieldsFor + +const createEditorPortfolio = (portfolio: Portfolio): EditorPortfolio => { + return { + id: { + name: 'id', + label: 'ID', + originalValue: portfolio.id, + currentValue: portfolio.id, + }, + name: { + name: 'name', + label: 'Name', + validation: [Validation.NotEmpty], + originalValue: portfolio.name, + currentValue: portfolio.name, + }, + description: { + name: 'description', + label: 'Description', + originalValue: portfolio.description, + currentValue: portfolio.description, + }, + adminDebugEnabled: { + name: 'adminDebugEnabled', + label: 'Admin Debugging Enabled', + originalValue: portfolio.adminDebugEnabled, + currentValue: portfolio.adminDebugEnabled, + }, + holdingsDate: { + name: 'holdingsDate', + label: 'Holdings Date', + originalValue: portfolio.holdingsDate, + currentValue: portfolio.holdingsDate, + }, + createdAt: { + name: 'createdAt', + label: 'Created At', + originalValue: portfolio.createdAt, + currentValue: portfolio.createdAt, + }, + numberOfRows: { + name: 'numberOfRows', + label: 'Number of Rows', + originalValue: portfolio.numberOfRows, + currentValue: portfolio.numberOfRows, + }, + } +} + +export const portfolioEditor = (i: Portfolio): EditorComputedValues => { + return getEditorComputedValues(`lib/editor/portfolio[${i.id}]`, i, createEditorPortfolio) +} diff --git a/frontend/lib/filesize/index.ts b/frontend/lib/filesize/index.ts new file mode 100644 index 0000000..bd63c96 --- /dev/null +++ b/frontend/lib/filesize/index.ts @@ -0,0 +1,9 @@ +export const formatFileSize = (bytes: number): string => { + if (bytes === 0) return 'Empty' + const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'] + + const k = 1024 + const i = Math.floor(Math.log(bytes) / Math.log(k)) + + return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i] +} diff --git a/frontend/openapi/generated/pacta/index.ts b/frontend/openapi/generated/pacta/index.ts index 2462bfa..a157015 100644 --- a/frontend/openapi/generated/pacta/index.ts +++ b/frontend/openapi/generated/pacta/index.ts @@ -10,7 +10,13 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise'; export { OpenAPI } from './core/OpenAPI'; export type { OpenAPIConfig } from './core/OpenAPI'; +export type { CompletePortfolioUploadReq } from './models/CompletePortfolioUploadReq'; +export type { CompletePortfolioUploadReqItem } from './models/CompletePortfolioUploadReqItem'; +export type { CompletePortfolioUploadResp } from './models/CompletePortfolioUploadResp'; export type { Error } from './models/Error'; +export type { HoldingsDate } from './models/HoldingsDate'; +export type { IncompleteUpload } from './models/IncompleteUpload'; +export type { IncompleteUploadChanges } from './models/IncompleteUploadChanges'; export { Initiative } from './models/Initiative'; export { InitiativeChanges } from './models/InitiativeChanges'; export { InitiativeCreate } from './models/InitiativeCreate'; @@ -19,12 +25,22 @@ export type { InitiativeInvitationCreate } from './models/InitiativeInvitationCr export type { InitiativeUserRelationship } from './models/InitiativeUserRelationship'; export type { InitiativeUserRelationshipChanges } from './models/InitiativeUserRelationshipChanges'; export { Language } from './models/Language'; +export type { ListIncompleteUploadsReq } from './models/ListIncompleteUploadsReq'; +export type { ListIncompleteUploadsResp } from './models/ListIncompleteUploadsResp'; +export type { ListPortfoliosReq } from './models/ListPortfoliosReq'; +export type { ListPortfoliosResp } from './models/ListPortfoliosResp'; export type { NewPortfolioAsset } from './models/NewPortfolioAsset'; export type { PactaVersion } from './models/PactaVersion'; export type { PactaVersionChanges } from './models/PactaVersionChanges'; export type { PactaVersionCreate } from './models/PactaVersionCreate'; export type { ParsePortfolioReq } from './models/ParsePortfolioReq'; export type { ParsePortfolioResp } from './models/ParsePortfolioResp'; +export type { Portfolio } from './models/Portfolio'; +export type { PortfolioChanges } from './models/PortfolioChanges'; +export type { StartPortfolioUploadReq } from './models/StartPortfolioUploadReq'; +export type { StartPortfolioUploadReqItem } from './models/StartPortfolioUploadReqItem'; +export type { StartPortfolioUploadResp } from './models/StartPortfolioUploadResp'; +export type { StartPortfolioUploadRespItem } from './models/StartPortfolioUploadRespItem'; export { User } from './models/User'; export { UserChanges } from './models/UserChanges'; diff --git a/frontend/openapi/generated/pacta/models/CompletePortfolioUploadReq.ts b/frontend/openapi/generated/pacta/models/CompletePortfolioUploadReq.ts new file mode 100644 index 0000000..60236ff --- /dev/null +++ b/frontend/openapi/generated/pacta/models/CompletePortfolioUploadReq.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { CompletePortfolioUploadReqItem } from './CompletePortfolioUploadReqItem'; + +export type CompletePortfolioUploadReq = { + /** + * The incomplete uploads that have been successfully uploaded to storage and are ready for parsing. + */ + items: Array; +}; + diff --git a/frontend/openapi/generated/pacta/models/CompletePortfolioUploadReqItem.ts b/frontend/openapi/generated/pacta/models/CompletePortfolioUploadReqItem.ts new file mode 100644 index 0000000..eef3190 --- /dev/null +++ b/frontend/openapi/generated/pacta/models/CompletePortfolioUploadReqItem.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type CompletePortfolioUploadReqItem = { + /** + * The unique identifier for the uploaded asset + */ + incomplete_upload_id: string; +}; + diff --git a/frontend/openapi/generated/pacta/models/CompletePortfolioUploadResp.ts b/frontend/openapi/generated/pacta/models/CompletePortfolioUploadResp.ts new file mode 100644 index 0000000..1dad40d --- /dev/null +++ b/frontend/openapi/generated/pacta/models/CompletePortfolioUploadResp.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type CompletePortfolioUploadResp = Record; diff --git a/frontend/openapi/generated/pacta/models/HoldingsDate.ts b/frontend/openapi/generated/pacta/models/HoldingsDate.ts new file mode 100644 index 0000000..11c37ae --- /dev/null +++ b/frontend/openapi/generated/pacta/models/HoldingsDate.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type HoldingsDate = { + /** + * The time at which the holdings are represented at + */ + time: string; +}; + diff --git a/frontend/openapi/generated/pacta/models/IncompleteUpload.ts b/frontend/openapi/generated/pacta/models/IncompleteUpload.ts new file mode 100644 index 0000000..ccb59d5 --- /dev/null +++ b/frontend/openapi/generated/pacta/models/IncompleteUpload.ts @@ -0,0 +1,47 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { HoldingsDate } from './HoldingsDate'; + +export type IncompleteUpload = { + /** + * Unique identifier for the incomplete upload + */ + id: string; + /** + * Name of the upload + */ + name: string; + /** + * Description of the upload + */ + description: string; + holdingsDate?: HoldingsDate; + /** + * The time when the upload was created + */ + createdAt: string; + /** + * The time when the upload process was run + */ + ranAt?: string; + /** + * The time when the upload was completed + */ + completedAt?: string; + /** + * Code describing the failure, if any + */ + failureCode?: string; + /** + * Message describing the failure, if any + */ + failureMessage?: string; + /** + * Flag to indicate whether admin debug mode is enabled + */ + adminDebugEnabled: boolean; +}; + diff --git a/frontend/openapi/generated/pacta/models/IncompleteUploadChanges.ts b/frontend/openapi/generated/pacta/models/IncompleteUploadChanges.ts new file mode 100644 index 0000000..1a7e3b5 --- /dev/null +++ b/frontend/openapi/generated/pacta/models/IncompleteUploadChanges.ts @@ -0,0 +1,20 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type IncompleteUploadChanges = { + /** + * Name of the upload + */ + name?: string; + /** + * Description of the upload + */ + description?: string; + /** + * Flag to indicate whether admin debug mode is enabled + */ + adminDebugEnabled?: boolean; +}; + diff --git a/frontend/openapi/generated/pacta/models/ListIncompleteUploadsReq.ts b/frontend/openapi/generated/pacta/models/ListIncompleteUploadsReq.ts new file mode 100644 index 0000000..d24d6df --- /dev/null +++ b/frontend/openapi/generated/pacta/models/ListIncompleteUploadsReq.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ListIncompleteUploadsReq = Record; diff --git a/frontend/openapi/generated/pacta/models/ListIncompleteUploadsResp.ts b/frontend/openapi/generated/pacta/models/ListIncompleteUploadsResp.ts new file mode 100644 index 0000000..2616abd --- /dev/null +++ b/frontend/openapi/generated/pacta/models/ListIncompleteUploadsResp.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { IncompleteUpload } from './IncompleteUpload'; + +export type ListIncompleteUploadsResp = { + items: Array; +}; + diff --git a/frontend/openapi/generated/pacta/models/ListPortfoliosReq.ts b/frontend/openapi/generated/pacta/models/ListPortfoliosReq.ts new file mode 100644 index 0000000..18bdc3a --- /dev/null +++ b/frontend/openapi/generated/pacta/models/ListPortfoliosReq.ts @@ -0,0 +1,6 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ListPortfoliosReq = Record; diff --git a/frontend/openapi/generated/pacta/models/ListPortfoliosResp.ts b/frontend/openapi/generated/pacta/models/ListPortfoliosResp.ts new file mode 100644 index 0000000..07978b9 --- /dev/null +++ b/frontend/openapi/generated/pacta/models/ListPortfoliosResp.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { Portfolio } from './Portfolio'; + +export type ListPortfoliosResp = { + items: Array; +}; + diff --git a/frontend/openapi/generated/pacta/models/Portfolio.ts b/frontend/openapi/generated/pacta/models/Portfolio.ts new file mode 100644 index 0000000..43c256d --- /dev/null +++ b/frontend/openapi/generated/pacta/models/Portfolio.ts @@ -0,0 +1,35 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { HoldingsDate } from './HoldingsDate'; + +export type Portfolio = { + /** + * the system assigned unique identifier of the portfolio + */ + id: string; + /** + * the human meaningful name of the portfolio + */ + name: string; + /** + * Additional information about the portfolio + */ + description: string; + /** + * The time at which this portfolio was successfully parsed from a raw + */ + createdAt: string; + holdingsDate?: HoldingsDate; + /** + * Whether the admin debug mode is enabled for this portfolio + */ + adminDebugEnabled: boolean; + /** + * The number of rows in the portfolio + */ + numberOfRows: number; +}; + diff --git a/frontend/openapi/generated/pacta/models/PortfolioChanges.ts b/frontend/openapi/generated/pacta/models/PortfolioChanges.ts new file mode 100644 index 0000000..5070f84 --- /dev/null +++ b/frontend/openapi/generated/pacta/models/PortfolioChanges.ts @@ -0,0 +1,20 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type PortfolioChanges = { + /** + * the human meaningful name of the portfolio + */ + name?: string; + /** + * Additional information about the portfolio + */ + description?: string; + /** + * Whether the admin debug mode is enabled for this portfolio + */ + adminDebugEnabled?: boolean; +}; + diff --git a/frontend/openapi/generated/pacta/models/StartPortfolioUploadReq.ts b/frontend/openapi/generated/pacta/models/StartPortfolioUploadReq.ts new file mode 100644 index 0000000..bc0feaf --- /dev/null +++ b/frontend/openapi/generated/pacta/models/StartPortfolioUploadReq.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { HoldingsDate } from './HoldingsDate'; +import type { StartPortfolioUploadReqItem } from './StartPortfolioUploadReqItem'; + +export type StartPortfolioUploadReq = { + items: Array; + holdings_date: HoldingsDate; +}; + diff --git a/frontend/openapi/generated/pacta/models/StartPortfolioUploadReqItem.ts b/frontend/openapi/generated/pacta/models/StartPortfolioUploadReqItem.ts new file mode 100644 index 0000000..4f4c35e --- /dev/null +++ b/frontend/openapi/generated/pacta/models/StartPortfolioUploadReqItem.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type StartPortfolioUploadReqItem = { + /** + * The name of the file, including its extension. + */ + file_name: string; +}; + diff --git a/frontend/openapi/generated/pacta/models/StartPortfolioUploadResp.ts b/frontend/openapi/generated/pacta/models/StartPortfolioUploadResp.ts new file mode 100644 index 0000000..064d782 --- /dev/null +++ b/frontend/openapi/generated/pacta/models/StartPortfolioUploadResp.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { StartPortfolioUploadRespItem } from './StartPortfolioUploadRespItem'; + +export type StartPortfolioUploadResp = { + items: Array; +}; + diff --git a/frontend/openapi/generated/pacta/models/StartPortfolioUploadRespItem.ts b/frontend/openapi/generated/pacta/models/StartPortfolioUploadRespItem.ts new file mode 100644 index 0000000..eef0fa2 --- /dev/null +++ b/frontend/openapi/generated/pacta/models/StartPortfolioUploadRespItem.ts @@ -0,0 +1,20 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type StartPortfolioUploadRespItem = { + /** + * The name of the file, including its extension, used as a round-trip id. + */ + file_name: string; + /** + * The signed URL where the file should be uploaded to, using PUT semantics. + */ + upload_url: string; + /** + * A unique identifier for the uploaded asset + */ + incomplete_upload_id: string; +}; + diff --git a/frontend/openapi/generated/pacta/services/DefaultService.ts b/frontend/openapi/generated/pacta/services/DefaultService.ts index fe208c3..a692609 100644 --- a/frontend/openapi/generated/pacta/services/DefaultService.ts +++ b/frontend/openapi/generated/pacta/services/DefaultService.ts @@ -2,6 +2,10 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { CompletePortfolioUploadReq } from '../models/CompletePortfolioUploadReq'; +import type { CompletePortfolioUploadResp } from '../models/CompletePortfolioUploadResp'; +import type { IncompleteUpload } from '../models/IncompleteUpload'; +import type { IncompleteUploadChanges } from '../models/IncompleteUploadChanges'; import type { Initiative } from '../models/Initiative'; import type { InitiativeChanges } from '../models/InitiativeChanges'; import type { InitiativeCreate } from '../models/InitiativeCreate'; @@ -9,12 +13,15 @@ import type { InitiativeInvitation } from '../models/InitiativeInvitation'; import type { InitiativeInvitationCreate } from '../models/InitiativeInvitationCreate'; import type { InitiativeUserRelationship } from '../models/InitiativeUserRelationship'; import type { InitiativeUserRelationshipChanges } from '../models/InitiativeUserRelationshipChanges'; -import type { NewPortfolioAsset } from '../models/NewPortfolioAsset'; +import type { ListIncompleteUploadsResp } from '../models/ListIncompleteUploadsResp'; +import type { ListPortfoliosResp } from '../models/ListPortfoliosResp'; import type { PactaVersion } from '../models/PactaVersion'; import type { PactaVersionChanges } from '../models/PactaVersionChanges'; import type { PactaVersionCreate } from '../models/PactaVersionCreate'; -import type { ParsePortfolioReq } from '../models/ParsePortfolioReq'; -import type { ParsePortfolioResp } from '../models/ParsePortfolioResp'; +import type { Portfolio } from '../models/Portfolio'; +import type { PortfolioChanges } from '../models/PortfolioChanges'; +import type { StartPortfolioUploadReq } from '../models/StartPortfolioUploadReq'; +import type { StartPortfolioUploadResp } from '../models/StartPortfolioUploadResp'; import type { User } from '../models/User'; import type { UserChanges } from '../models/UserChanges'; @@ -400,6 +407,152 @@ export class DefaultService { }); } + /** + * Gets the incomplete uploads that the user is the owner of + * @returns ListIncompleteUploadsResp + * @throws ApiError + */ + public listIncompleteUploads(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/incomplete-uploads', + }); + } + + /** + * Returns an incomplete upload by ID + * Returns an incomplete upload based on a single ID + * @param id ID of incomplete upload to fetch + * @returns IncompleteUpload incomplete upload response + * @throws ApiError + */ + public findIncompleteUploadById( + id: string, + ): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/incomplete-upload/{id}', + path: { + 'id': id, + }, + }); + } + + /** + * Updates incomplete upload properties + * Updates a incomplete upload's settable properties + * @param id ID of incomplete upload to update + * @param requestBody Incomplete Upload object properties to update + * @returns void + * @throws ApiError + */ + public updateIncompleteUpload( + id: string, + requestBody: IncompleteUploadChanges, + ): CancelablePromise { + return this.httpRequest.request({ + method: 'PATCH', + url: '/incomplete-upload/{id}', + path: { + 'id': id, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + + /** + * Deletes an incomplete upload by ID + * deletes an incomplete upload based on the ID supplied + * @param id ID of incomplete upload to delete + * @returns void + * @throws ApiError + */ + public deleteIncompleteUpload( + id: string, + ): CancelablePromise { + return this.httpRequest.request({ + method: 'DELETE', + url: '/incomplete-upload/{id}', + path: { + 'id': id, + }, + }); + } + + /** + * Gets the list of portfolios that the user is the owner of + * @returns ListPortfoliosResp + * @throws ApiError + */ + public listPortfolios(): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/portfolios', + }); + } + + /** + * Returns an portfolio by ID + * Returns an portfolio based on a single ID + * @param id ID of portfolio to fetch + * @returns Portfolio portfolio response + * @throws ApiError + */ + public findPortfolioById( + id: string, + ): CancelablePromise { + return this.httpRequest.request({ + method: 'GET', + url: '/portfolio/{id}', + path: { + 'id': id, + }, + }); + } + + /** + * Updates portfolio properties + * Updates a portfolio's settable properties + * @param id ID of portfolio to update + * @param requestBody portfolio object properties to update + * @returns void + * @throws ApiError + */ + public updatePortfolio( + id: string, + requestBody: PortfolioChanges, + ): CancelablePromise { + return this.httpRequest.request({ + method: 'PATCH', + url: '/portfolio/{id}', + path: { + 'id': id, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + + /** + * Deletes an portfolio by ID + * deletes an portfolio based on the ID supplied + * @param id ID of portfolio to delete + * @returns void + * @throws ApiError + */ + public deletePortfolio( + id: string, + ): CancelablePromise { + return this.httpRequest.request({ + method: 'DELETE', + url: '/portfolio/{id}', + path: { + 'id': id, + }, + }); + } + /** * gets info about the logged in user * Returns the logged in user, if the user is logged in, otherwise returns empty @@ -488,35 +641,36 @@ export class DefaultService { } /** - * Test endpoint, creates a new portfolio asset - * Creates a new asset for a portfolio - * - * Returns a signed URL where the portfolio can be uploaded to. - * - * @returns NewPortfolioAsset The asset can now be uploaded via the given signed URL. + * Starts the process of uploading one or more portfolio files + * Creates one or more new incomplete portfolio uploads, and creates upload URLs for the user to put their blobs into. + * @param requestBody A request describing the portfolios that the user wants to upload + * @returns StartPortfolioUploadResp The assets can now be uploaded via the given signed URLs. * @throws ApiError */ - public createPortfolioAsset(): CancelablePromise { + public startPortfolioUpload( + requestBody: StartPortfolioUploadReq, + ): CancelablePromise { return this.httpRequest.request({ method: 'POST', - url: '/test:createPortfolioAsset', + url: '/portfolio-upload', + body: requestBody, + mediaType: 'application/json', }); } /** - * Test endpoint, triggers a task to process the portfolio - * Starts processing raw uploaded files - * - * @param requestBody The raw portfolio files to process - * @returns ParsePortfolioResp The task has been started successfully + * Called after uploads of portfolios to cloud storage are complete. + * Signals that the upload of the portfolios are complete, and that the server should start parsing them. + * @param requestBody A request describing the incomplete uploads that the user wants to begin processing + * @returns CompletePortfolioUploadResp The process to initiate the parsing of the uploads has been initiated. * @throws ApiError */ - public parsePortfolio( - requestBody: ParsePortfolioReq, - ): CancelablePromise { + public completePortfolioUpload( + requestBody: CompletePortfolioUploadReq, + ): CancelablePromise { return this.httpRequest.request({ method: 'POST', - url: '/test:parsePortfolio', + url: '/portfolio-upload:complete', body: requestBody, mediaType: 'application/json', }); diff --git a/frontend/pages/admin/portfolio_test.vue b/frontend/pages/admin/portfolio_test.vue deleted file mode 100644 index 72176eb..0000000 --- a/frontend/pages/admin/portfolio_test.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/frontend/pages/incomplete-uploads.vue b/frontend/pages/incomplete-uploads.vue new file mode 100644 index 0000000..8335942 --- /dev/null +++ b/frontend/pages/incomplete-uploads.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/frontend/pages/index.vue b/frontend/pages/index.vue index a0c6b3e..8f1861d 100644 --- a/frontend/pages/index.vue +++ b/frontend/pages/index.vue @@ -17,14 +17,24 @@ const { signIn } = useSignIn() - + diff --git a/frontend/pages/portfolios.vue b/frontend/pages/portfolios.vue new file mode 100644 index 0000000..2449ddd --- /dev/null +++ b/frontend/pages/portfolios.vue @@ -0,0 +1,170 @@ + + + + + diff --git a/frontend/pages/upload.vue b/frontend/pages/upload.vue new file mode 100644 index 0000000..5e303f3 --- /dev/null +++ b/frontend/pages/upload.vue @@ -0,0 +1,407 @@ + + + diff --git a/frontend/plugins/primevue.ts b/frontend/plugins/primevue.ts index 9c31e02..052f7b1 100644 --- a/frontend/plugins/primevue.ts +++ b/frontend/plugins/primevue.ts @@ -5,6 +5,7 @@ import PrimeVue from 'primevue/config' import Accordion from 'primevue/accordion' import AccordionTab from 'primevue/accordiontab' import Button from 'primevue/button' +import Calendar from 'primevue/calendar' import Card from 'primevue/card' import Column from 'primevue/column' import DataTable from 'primevue/datatable' @@ -30,6 +31,7 @@ export default defineNuxtPlugin(({ vueApp }) => { vueApp.component('PVAccordion', Accordion) vueApp.component('PVAccordionTab', AccordionTab) vueApp.component('PVButton', Button) + vueApp.component('PVCalendar', Calendar) vueApp.component('PVCard', Card) vueApp.component('PVColumn', Column) vueApp.component('PVDataTable', DataTable)