mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 13:02:56 +00:00
fix publication details
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { IActionLocalRepository } from 'src/app/core/chat/repository/action/member-local-repository';
|
||||
import { ActionTable, ActionTableSchema } from 'src/app/infra/database/dexie/instance/action/schema/action';
|
||||
import { actionDatabase } from 'src/app/infra/database/dexie/instance/action/service';
|
||||
import { DexieRepository } from 'src/app/infra/repository/dexie/dexie-repository.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ActionLocalRepositoryService extends DexieRepository<ActionTable, ActionTable> implements IActionLocalRepository {
|
||||
constructor() {
|
||||
super(actionDatabase.action, ActionTableSchema, actionDatabase)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { ActionsCreateInput } from 'src/app/core/actions/use-case/actions-create-use-case.service';
|
||||
import { ActionGetAllOutPut } from 'src/app/core/actions/use-case/actions-get-all-use-case.service';
|
||||
import { PublicationGetDocumentByProcessIdOutPut } from 'src/app/core/actions/use-case/publication-get-documents-by-document-id.service';
|
||||
import { PublicationListByProcessIdOutPut } from 'src/app/core/actions/use-case/publication-list-by-process-id.service';
|
||||
import { HttpService } from 'src/app/infra/http/http.service';
|
||||
import { ApiResponse } from 'src/app/infra/http/type';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ActionRemoteRepositoryService {
|
||||
|
||||
private baseUrl = `${environment.apiURLStage.slice(0, -1)}/PresidentialActions`; // Your base URL
|
||||
|
||||
constructor(
|
||||
private http: HttpService
|
||||
) { }
|
||||
|
||||
async actionGetAll() {
|
||||
return await this.http.get<ApiResponse<ActionGetAllOutPut>>(`${this.baseUrl}`);
|
||||
}
|
||||
|
||||
async create(input: ActionsCreateInput) {
|
||||
return await this.http.post<ApiResponse<any>>(`${this.baseUrl}`, input);
|
||||
}
|
||||
|
||||
async postGetListByProcessId(processId: string) {
|
||||
return await this.http.get<ApiResponse<PublicationListByProcessIdOutPut>>(`${this.baseUrl}/${processId}/Posts`);
|
||||
}
|
||||
|
||||
async postGetDocumentListByProcessId(documentId: number) {
|
||||
var result = await this.http.get<ApiResponse<PublicationGetDocumentByProcessIdOutPut>>(`${this.baseUrl}/Posts/${documentId}/file`);
|
||||
|
||||
return result.map((e) => {
|
||||
// Add a new attribute to each item
|
||||
e.data.data = e.data.data.map((item) => ({
|
||||
...item,
|
||||
documentId,
|
||||
}));
|
||||
return e;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { PublicationFileTable, PublicationFileTableSchema } from 'src/app/infra/database/dexie/instance/action/schema/publicationFile';
|
||||
import { actionDatabase } from 'src/app/infra/database/dexie/instance/action/service';
|
||||
import { DexieRepository } from 'src/app/infra/repository/dexie/dexie-repository.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PublicationFileLocalRepositoryService extends DexieRepository<PublicationFileTable, PublicationFileTable> {
|
||||
|
||||
constructor() {
|
||||
super(actionDatabase.publicationFile, PublicationFileTableSchema, actionDatabase)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { PublicationFileGetByDocumentIdInput, PublicationFileGetByDocumentIdOutPut } from 'src/app/core/actions/use-case/publication-file-get-by-document-id.service';
|
||||
import { PublicationListByProcessIdOutPut } from 'src/app/core/actions/use-case/publication-list-by-process-id.service';
|
||||
import { ApiResponse } from 'src/app/infra/http/type';
|
||||
import { HttpService } from 'src/app/services/http.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PublicationFileRemoteRepositoryService {
|
||||
|
||||
private baseUrl = `${environment.apiURLStage.slice(0, -1)}/PresidentialActions`; // Your base URL
|
||||
|
||||
constructor(
|
||||
private http: HttpService
|
||||
) { }
|
||||
|
||||
async listByProcessId(processId: string) {
|
||||
console.log(this.baseUrl);
|
||||
return await this.http.get<ApiResponse<PublicationListByProcessIdOutPut>>(`${this.baseUrl}/${processId}/Posts`);
|
||||
}
|
||||
|
||||
async FileListByDocumentId(input: PublicationFileGetByDocumentIdInput) {
|
||||
return await this.http.get<ApiResponse<PublicationFileGetByDocumentIdOutPut>>(`${this.baseUrl}/Posts/${input.documentId}/file`);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PublicationFileRepositoryService {
|
||||
|
||||
constructor() { }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { PublicationTable, PublicationTableSchema } from 'src/app/infra/database/dexie/instance/action/schema/publication';
|
||||
import { PublicationFileTable } from 'src/app/infra/database/dexie/instance/action/schema/publicationFile';
|
||||
import { actionDatabase } from 'src/app/infra/database/dexie/instance/action/service';
|
||||
import { DexieRepository } from 'src/app/infra/repository/dexie/dexie-repository.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PublicationLocalRepositoryService extends DexieRepository<PublicationTable, PublicationTable> {
|
||||
|
||||
constructor() {
|
||||
super(actionDatabase.publication, PublicationTableSchema, actionDatabase)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { PublicationListByProcessIdOutPut } from 'src/app/core/actions/use-case/publication-list-by-process-id.service';
|
||||
import { HttpService } from 'src/app/infra/http/http.service';
|
||||
import { ApiResponse } from 'src/app/infra/http/type';
|
||||
import { environment } from 'src/environments/environment';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class PublicationRemoteRepositoryService {
|
||||
|
||||
private baseUrl = `${environment.apiURLStage.slice(0, -1)}/PresidentialActions`; // Your base URL
|
||||
|
||||
constructor(
|
||||
private http: HttpService
|
||||
) { }
|
||||
|
||||
async listByProcessId(processId: number) {
|
||||
return await this.http.get<ApiResponse<PublicationListByProcessIdOutPut>>(`${this.baseUrl}/${processId}/Posts`);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
import { z } from "zod";
|
||||
import { SharedCalendarListItemOutputDTO } from "../../dto/sharedCalendarOutputDTO";
|
||||
|
||||
type Changes = {
|
||||
|
||||
@@ -28,14 +28,14 @@ const OwnerSchema = z.object({
|
||||
wxUserId: z.number(),
|
||||
wxFullName: z.string(),
|
||||
wxeMail: z.string(),
|
||||
userPhoto: z.string().nullable(),
|
||||
userPhoto: z.string().nullable().optional(),
|
||||
});
|
||||
|
||||
const OrganizerSchema = z.object({
|
||||
wxUserId: z.number(),
|
||||
wxFullName: z.string(),
|
||||
wxeMail: z.string(),
|
||||
userPhoto: z.string().nullable(),
|
||||
userPhoto: z.string().nullable().optional(),
|
||||
});
|
||||
|
||||
const EventRecurrenceSchema = z.object({
|
||||
|
||||
@@ -5,7 +5,7 @@ const OwnerSchema = z.object({
|
||||
wxUserId: z.number(),
|
||||
wxFullName: z.string(),
|
||||
wxeMail: z.string(),
|
||||
userPhoto: z.string().nullable(),
|
||||
userPhoto: z.string().nullable().optional(),
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ const OwnerSchema = z.object({
|
||||
wxUserId: z.number(),
|
||||
wxFullName: z.string(),
|
||||
wxeMail: z.string(),
|
||||
userPhoto: z.string().nullable(),
|
||||
userPhoto: z.string().nullable().optional(),
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -20,10 +20,9 @@ export class MemberListRemoteRepository implements IMemberRemoteRepository {
|
||||
|
||||
@ValidateSchema(AddMemberToRoomInputDTOSchema)
|
||||
async addMemberToRoom(data: AddMemberToRoomInputDTO): DataSourceReturn<AddMemberToRoomInputDTO> {
|
||||
return await this.httpService.post<any>(`${this.baseUrl}/Room/${data.id}/Member`, { members:data.members });
|
||||
return await this.httpService.post<any>(`${this.baseUrl}/Room/${data.id}/Member`, { members:data.members, userId: data.userId });
|
||||
}
|
||||
|
||||
|
||||
@ValidateSchema(UserRemoveListInputDTOSchema)
|
||||
async removeMemberFromRoom(data: UserRemoveListInputDTO): Promise<Result<any ,any>> {
|
||||
return await this.httpService.delete<any>(`${this.baseUrl}/Room/${data.id}/Member`, {} , {members:data.members});
|
||||
|
||||
@@ -80,6 +80,7 @@ export class RoomRemoteDataSourceService implements IRoomRemoteRepository {
|
||||
const result = await this.socket.sendData({
|
||||
method: 'AddRoomMember',
|
||||
data: {
|
||||
userId: SessionStore.user.UserId,
|
||||
requestId: uuidv4(),
|
||||
roomId: data.id,
|
||||
members: data.members
|
||||
|
||||
@@ -126,7 +126,7 @@ export class ChatServiceService {
|
||||
})
|
||||
|
||||
this.MessageSocketRepositoryService.listenToUpdateMessages().pipe(
|
||||
filter((message) => message.deviceId != getInstanceId())
|
||||
filter((message) => message?.deviceId != getInstanceId())
|
||||
).subscribe(async (message) => {
|
||||
if(message?.id) {
|
||||
this.SocketMessageUpdateUseCaseService.execute(message)
|
||||
@@ -135,7 +135,7 @@ export class ChatServiceService {
|
||||
|
||||
this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||
map(message => message.data),
|
||||
filter((message) => message.deviceId != getInstanceId())
|
||||
filter((message) => message?.deviceId != getInstanceId())
|
||||
).subscribe(async (message) => {
|
||||
if(message?.id) {
|
||||
this.SocketMessageCreateUseCaseService.execute(message)
|
||||
|
||||
@@ -20,7 +20,7 @@ export class RoomLastMessageService {
|
||||
listenToIncomingMessage() {
|
||||
return this.MessageSocketRepositoryService.listenToMessages().pipe(
|
||||
map(message => message.data),
|
||||
filter((message) => message.deviceId != getInstanceId()),
|
||||
filter((message) => message?.deviceId != getInstanceId()),
|
||||
map(message => Object.assign(new MessageEntity(), message))
|
||||
).subscribe(async (message) => {
|
||||
this.roomLocalRepository.update(message.roomId, {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { z } from "zod";
|
||||
import { NotificationTable } from '../../infra/db/notification.db'
|
||||
|
||||
type Changes = {
|
||||
|
||||
Reference in New Issue
Block a user