/* * Copyright 2024 Adobe. All rights reserved. * This file is licensed to you under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. You may obtain a copy * of the License at http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software distributed under * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS * OF ANY KIND, either express or implied. See the License for the specific language * governing permissions and limitations under the License. */ import type { Audit, BaseCollection, BaseModel, FixEntity, MultiStatusCreateResult, Site, Suggestion, } from '../index'; export interface Opportunity extends BaseModel { addSuggestions(suggestions: object[]): Promise>; addFixEntities(fixEntities: object[]): Promise>; getAudit(): Promise; getAuditId(): string; getData(): object; getDescription(): string; getFixEntities(): Promise; getGuidance(): string; getLastAuditedAt(): string; getOrigin(): string; getRunbook(): string; getScopeId(): string | undefined; getScopeType(): string | undefined; getSite(): Promise; getSiteId(): string; getStatus(): string; getSuggestions(): Promise; getSuggestionsByStatus(status: string): Promise; getSuggestionsByStatusAndRank(status: string, rank: string): Promise; getTags(): string[]; getTitle(): string; getType(): string; setAuditId(auditId: string): Opportunity; setData(data: object): Opportunity; setDescription(description: string): Opportunity; setGuidance(guidance: string): Opportunity; setLastAuditedAt(lastAuditedAt: string): Opportunity; setOrigin(origin: string): Opportunity; setRunbook(runbook: string): Opportunity; setScopeId(scopeId: string | null | undefined): Opportunity; setScopeType(scopeType: 'brand' | null | undefined): Opportunity; setSiteId(siteId: string): Opportunity; setStatus(status: string): Opportunity; setTags(tags: string[]): Opportunity; setTitle(title: string): Opportunity; } export interface OpportunityCollection extends BaseCollection { allByScope(scopeType: string, scopeId: string): Promise; allByAuditId(auditId: string): Promise; allByAuditIdAndUpdatedAt(auditId: string, updatedAt: string): Promise; allBySiteId(siteId: string): Promise; allBySiteIdAndStatus(siteId: string, status: string): Promise; allBySiteIdAndStatusAndUpdatedAt( siteId: string, status: string, updatedAt: string ): Promise; findByAuditId(auditId: string): Promise; findByAuditIdAndUpdatedAt(auditId: string, updatedAt: string): Promise; findBySiteId(siteId: string): Promise; findBySiteIdAndStatus(siteId: string, status: string): Promise; findBySiteIdAndStatusAndUpdatedAt( siteId: string, status: string, updatedAt: string ): Promise; }