Files
trueref-legacy/src/lib/server/models/repository-version.ts
2026-03-25 19:03:22 +01:00

107 lines
2.6 KiB
TypeScript

export interface RepositoryVersionEntityProps {
id: string;
repository_id: string;
tag: string;
title: string | null;
commit_hash: string | null;
state: 'pending' | 'indexing' | 'indexed' | 'error';
total_snippets: number | null;
indexed_at: number | null;
created_at: number;
}
export class RepositoryVersionEntity {
id: string;
repository_id: string;
tag: string;
title: string | null;
commit_hash: string | null;
state: 'pending' | 'indexing' | 'indexed' | 'error';
total_snippets: number | null;
indexed_at: number | null;
created_at: number;
constructor(props: RepositoryVersionEntityProps) {
this.id = props.id;
this.repository_id = props.repository_id;
this.tag = props.tag;
this.title = props.title;
this.commit_hash = props.commit_hash;
this.state = props.state;
this.total_snippets = props.total_snippets;
this.indexed_at = props.indexed_at;
this.created_at = props.created_at;
}
}
export interface RepositoryVersionProps {
id: string;
repositoryId: string;
tag: string;
title: string | null;
commitHash: string | null;
state: 'pending' | 'indexing' | 'indexed' | 'error';
totalSnippets: number;
indexedAt: Date | null;
createdAt: Date;
}
export class RepositoryVersion {
id: string;
repositoryId: string;
tag: string;
title: string | null;
commitHash: string | null;
state: 'pending' | 'indexing' | 'indexed' | 'error';
totalSnippets: number;
indexedAt: Date | null;
createdAt: Date;
constructor(props: RepositoryVersionProps) {
this.id = props.id;
this.repositoryId = props.repositoryId;
this.tag = props.tag;
this.title = props.title;
this.commitHash = props.commitHash;
this.state = props.state;
this.totalSnippets = props.totalSnippets;
this.indexedAt = props.indexedAt;
this.createdAt = props.createdAt;
}
}
export interface RepositoryVersionDtoProps {
id: string;
repositoryId: string;
tag: string;
title: string | null;
commitHash: string | null;
state: 'pending' | 'indexing' | 'indexed' | 'error';
totalSnippets: number;
indexedAt: Date | null;
createdAt: Date;
}
export class RepositoryVersionDto {
id: string;
repositoryId: string;
tag: string;
title: string | null;
commitHash: string | null;
state: 'pending' | 'indexing' | 'indexed' | 'error';
totalSnippets: number;
indexedAt: Date | null;
createdAt: Date;
constructor(props: RepositoryVersionDtoProps) {
this.id = props.id;
this.repositoryId = props.repositoryId;
this.tag = props.tag;
this.title = props.title;
this.commitHash = props.commitHash;
this.state = props.state;
this.totalSnippets = props.totalSnippets;
this.indexedAt = props.indexedAt;
this.createdAt = props.createdAt;
}
}