diff --git a/cmd/server/pactasrv/portfolio.go b/cmd/server/pactasrv/portfolio.go index ad35877..cffc7fb 100644 --- a/cmd/server/pactasrv/portfolio.go +++ b/cmd/server/pactasrv/portfolio.go @@ -39,3 +39,9 @@ func (s *Server) ParsePortfolio(ctx context.Context, req api.ParsePortfolioReque TaskId: string(taskID), }, nil } + +// (GET /portfolios) + +func (s *Server) ListPortfolios(ctx context.Context, request api.ListPortfoliosRequestObject) (api.ListPortfoliosResponseObject, error) { + return nil, oapierr.NotImplemented("not implemented") +} diff --git a/cmd/server/pactasrv/upload.go b/cmd/server/pactasrv/upload.go index a9c6498..55335cd 100644 --- a/cmd/server/pactasrv/upload.go +++ b/cmd/server/pactasrv/upload.go @@ -2,19 +2,24 @@ package pactasrv import ( "context" - "fmt" + "github.com/RMI/pacta/oapierr" api "github.com/RMI/pacta/openapi/pacta" ) // Starts the process of uploading one or more portfolio files // (POST /portfolio-upload) func (s *Server) StartPortfolioUpload(ctx context.Context, request api.StartPortfolioUploadRequestObject) (api.StartPortfolioUploadResponseObject, error) { - return nil, fmt.Errorf("not implemented") + return nil, oapierr.NotImplemented("not implemented") } // Called after uploads of portfolios to cloud storage are complete. // (POST /portfolio-upload:complete) func (s *Server) CompletePortfolioUpload(ctx context.Context, request api.CompletePortfolioUploadRequestObject) (api.CompletePortfolioUploadResponseObject, error) { - return nil, fmt.Errorf("not implemented") + return nil, oapierr.NotImplemented("not implemented") +} + +// (GET /incomplete-uploads) +func (s *Server) ListIncompleteUploads(ctx context.Context, request api.ListIncompleteUploadsRequestObject) (api.ListIncompleteUploadsResponseObject, error) { + return nil, oapierr.NotImplemented("not implemented") } diff --git a/openapi/pacta.yaml b/openapi/pacta.yaml index 0ba82be..0f08a94 100644 --- a/openapi/pacta.yaml +++ b/openapi/pacta.yaml @@ -371,6 +371,40 @@ paths: responses: '204': description: the relationship changes were applied successfully + /incomplete-uploads: + get: + description: Gets the incomplete uploads that the user is the owner of + operationId: listIncompleteUploads + requestBody: + description: A request describing the incomplete uploads to return + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ListIncompleteUploadsReq' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListIncompleteUploadsResp' + /portfolios: + get: + description: Gets the list of portfolios that the user is the owner of + operationId: listPortfolios + requestBody: + description: A request describing the portfolios to return + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ListPortfoliosReq' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ListPortfoliosResp' /user/me: get: description: Returns the logged in user, if the user is logged in, otherwise returns empty @@ -944,6 +978,109 @@ components: analysis_id: type: string description: The analysis id to track for the parsing task. + HoldingsDate: + type: object + required: + - time + properties: + time: + type: string + format: date-time + description: The time at which the holdings are represented at + IncompleteUpload: + type: object + required: + - id + - name + - description + - createdAt + - adminDebugEnabled + properties: + id: + type: string # Assuming IncompleteUploadID is a string, otherwise define its structure + description: Unique identifier for the incomplete upload + name: + type: string + description: Name of the upload + description: + type: string + description: Description of the upload + holdingsDate: + $ref: '#/components/schemas/HoldingsDate' + createdAt: + type: string + format: date-time + description: The time when the upload was created + ranAt: + type: string + format: date-time + description: The time when the upload process was run + completedAt: + type: string + format: date-time + description: The time when the upload was completed + failureCode: + type: string + description: Code describing the failure, if any + failureMessage: + type: string + description: Message describing the failure, if any + adminDebugEnabled: + type: boolean + description: Flag to indicate whether admin debug mode is enabled + Portfolio: + type: object + required: + - id + - name + - description + - createdAt + - adminDebugEnabled + - numberOfRows + properties: + id: + type: string + description: the system assigned unique identifier of the portfolio + name: + type: string + description: the human meaningful name of the portfolio + description: + type: string + description: Additional information about the portfolio + createdAt: + type: string + format: date-time + description: The time at which this portfolio was successfully parsed from a raw + holdingsDate: + $ref: '#/components/schemas/HoldingsDate' + adminDebugEnabled: + type: boolean + description: Whether the admin debug mode is enabled for this portfolio + numberOfRows: + type: integer + description: The number of rows in the portfolio + ListIncompleteUploadsReq: + type: object + ListIncompleteUploadsResp: + type: object + required: + - items + properties: + items: + type: array + items: + $ref: '#/components/schemas/IncompleteUpload' + ListPortfoliosReq: + type: object + ListPortfoliosResp: + type: object + required: + - items + properties: + items: + type: array + items: + $ref: '#/components/schemas/Portfolio' ParsePortfolioReq: type: object required: