Notif finished
This commit is contained in:
parent
643ba11732
commit
d45fee73e5
802
package-lock.json
generated
802
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -52,7 +52,7 @@
|
||||
"cron": "^2.3.1",
|
||||
"express": "^4.18.2",
|
||||
"jsonwebtoken": "^9.0.0",
|
||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.72",
|
||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.79",
|
||||
"module-alias": "^2.2.2",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"next": "^13.1.5",
|
||||
|
@ -10,15 +10,11 @@ export default class NotificationBuilder {
|
||||
public constructor(private notificationsService : NotificationsService, private documentsService: DocumentsService){}
|
||||
|
||||
public async sendDocumentDepositedNotification(documentEntity: Documents){
|
||||
console.log(documentEntity);
|
||||
if(documentEntity.document_status !== "DEPOSITED") return;
|
||||
|
||||
|
||||
|
||||
const documentPrisma = await this.documentsService.getByUid(documentEntity.uid, { depositor: {include: {contact: true}}, folder:{include:{ office: true, stakeholders: true}} });
|
||||
if(!documentPrisma) throw new Error("Document not found");
|
||||
const document = Document.hydrate<Document>(documentPrisma);
|
||||
console.log(document);
|
||||
|
||||
this.notificationsService.create({
|
||||
message: "Document déposé",
|
||||
@ -33,16 +29,16 @@ export default class NotificationBuilder {
|
||||
public async sendDocumentAnchoredNotificatiom(documentEntity: Documents){
|
||||
if(documentEntity.document_status !== "ANCHORED") return;
|
||||
|
||||
const documentPrisma = await this.documentsService.getByUid(documentEntity.uid, { depositor: {include: {contact: true}}, folder:{include:{ office: true}} });
|
||||
const documentPrisma = await this.documentsService.getByUid(documentEntity.uid, { depositor: {include: {contact: true}}, folder:{include:{ office: true, stakeholders: true}} });
|
||||
if(!documentPrisma) throw new Error("Document not found");
|
||||
const document = Document.hydrate<Document>(documentPrisma);
|
||||
console.log(document);
|
||||
|
||||
this.notificationsService.create({
|
||||
message: "Document anchré",
|
||||
message: "Document ancré",
|
||||
redirection_url: "",
|
||||
created_at: new Date(),
|
||||
updated_at: new Date(),
|
||||
user : document.folder!.stakeholders || [],
|
||||
});
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user