mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
save
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
import { HttpErrorResponse } from "@angular/common/http";
|
||||
import { Err, Result } from "neverthrow";
|
||||
import { HttpResult } from "src/app/infra/http/type";
|
||||
import { OK } from "zod";
|
||||
|
||||
export abstract class ITaskRemoteRepository {
|
||||
abstract uploadDoc(id: string | number): Promise<Err<HttpResult<unknown>, HttpErrorResponse> | OK<boolean>>
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { SignalRService } from 'src/app/infra/socket/signalR/signal-r.service';
|
||||
import { ISignalRService } from 'src/app/infra/socket/adapter';
|
||||
import { HttpModule } from 'src/app/infra/http/http.module';
|
||||
@NgModule({
|
||||
imports: [HttpModule],
|
||||
providers: [
|
||||
{
|
||||
provide: ISignalRService,
|
||||
useClass: SignalRService, // or MockDataService
|
||||
},
|
||||
],
|
||||
declarations: [],
|
||||
schemas: [],
|
||||
entryComponents: []
|
||||
})
|
||||
export class GabineteModule {
|
||||
constructor() {}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { TestBed } from '@angular/core/testing';
|
||||
|
||||
import { TaskRepoService } from './task-repo.service';
|
||||
|
||||
describe('TaskRepoService', () => {
|
||||
let service: TaskRepoService;
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({});
|
||||
service = TestBed.inject(TaskRepoService);
|
||||
});
|
||||
|
||||
it('should be created', () => {
|
||||
expect(service).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,49 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { HttpAdapter } from 'src/app/infra/http/adapter';
|
||||
import { OK } from 'zod';
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Err } from 'neverthrow';
|
||||
import { HttpResult } from 'src/app/infra/http/type';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
|
||||
export function instanceIdGenerator() {
|
||||
const now = new Date();
|
||||
const prefix = 'DC';
|
||||
|
||||
const formattedDate = now.toISOString()
|
||||
.replace('T', ' ')
|
||||
.replace('Z', '')
|
||||
.slice(0, 23); // yyyy-MM-dd HH:mm:ss.SSS
|
||||
|
||||
return `${prefix}_${SessionStore.user.Email}_${formattedDate}`;
|
||||
}
|
||||
|
||||
interface UploadDocInputDto {
|
||||
InstanceId: string;
|
||||
UserId: string;
|
||||
Source: string;
|
||||
FileExtension: string;
|
||||
FileBase64: string;
|
||||
OriginalFileName: string;
|
||||
}
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class TaskRepoService {
|
||||
|
||||
constructor(
|
||||
private http: HttpAdapter
|
||||
) { }
|
||||
|
||||
async uploadDoc(input: UploadDocInputDto[]): Promise<Err<HttpResult<unknown>, HttpErrorResponse> | OK<boolean>> {
|
||||
for(const attachment in input) {
|
||||
var result = await this.http.post('/Tasks/AttachDocImage', attachment);
|
||||
|
||||
if(result.isErr()) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return OK(true);
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "c14431034",
|
||||
"SHA": "c14431034c00c209b7d19da993a69539a644f575",
|
||||
"shortSHA": "2673f8a17",
|
||||
"SHA": "2673f8a17a4f684fe1b91748fa455f2327d451a3",
|
||||
"branch": "developer",
|
||||
"lastCommitAuthor": "'peter.maquiran'",
|
||||
"lastCommitTime": "'Fri Oct 17 16:20:48 2025 +0100'",
|
||||
"lastCommitMessage": "remove duplicate calls",
|
||||
"lastCommitNumber": "6154",
|
||||
"changeStatus": "On branch developer\nYour branch is ahead of 'origin/developer' by 11 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tnew file: ios-build.md\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/environments/suport/dev.ts",
|
||||
"lastCommitTime": "'Tue Jan 6 11:58:59 2026 +0100'",
|
||||
"lastCommitMessage": "set expediente as default and fix assinar diploma",
|
||||
"lastCommitNumber": "6155",
|
||||
"changeStatus": "On branch developer\nYour branch is up to date with 'origin/developer'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tnew file: src/app/core/gabinete/repository/task-remote-repository.ts\n\tnew file: src/app/module/gabinete/chat.module.ts\n\tnew file: src/app/module/gabinete/data/repository/task-repo.service.spec.ts\n\tnew file: src/app/module/gabinete/data/repository/task-repo.service.ts\n\tmodified: version/git-version.ts",
|
||||
"changeAuthor": "peter.maquiran"
|
||||
}
|
||||
Reference in New Issue
Block a user