Merge branch 'dev' into staging
This commit is contained in:
commit
3d6d5d03d7
@ -59,7 +59,7 @@
|
|||||||
"file-type-checker": "^1.0.8",
|
"file-type-checker": "^1.0.8",
|
||||||
"fp-ts": "^2.16.1",
|
"fp-ts": "^2.16.1",
|
||||||
"jsonwebtoken": "^9.0.0",
|
"jsonwebtoken": "^9.0.0",
|
||||||
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.126",
|
"le-coffre-resources": "git@github.com:smart-chain-fr/leCoffre-resources.git#v2.130",
|
||||||
"module-alias": "^2.2.2",
|
"module-alias": "^2.2.2",
|
||||||
"monocle-ts": "^2.3.13",
|
"monocle-ts": "^2.3.13",
|
||||||
"multer": "^1.4.5-lts.1",
|
"multer": "^1.4.5-lts.1",
|
||||||
|
@ -832,6 +832,39 @@ export default async function main() {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const rulesGroups = [
|
||||||
|
{
|
||||||
|
name: "Gestion des types d'actes et des documents",
|
||||||
|
created_at: new Date(),
|
||||||
|
updated_at: new Date(),
|
||||||
|
rules: [
|
||||||
|
"POST deeds",
|
||||||
|
"PUT deeds",
|
||||||
|
"DELETE deeds",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Gestion de l'abonnement",
|
||||||
|
created_at: new Date(),
|
||||||
|
updated_at: new Date(),
|
||||||
|
rules : [
|
||||||
|
"GET subscriptions",
|
||||||
|
"POST subscriptions",
|
||||||
|
"PUT subscriptions",
|
||||||
|
"GET stripe",
|
||||||
|
"POST stripe",
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Gestion du RIB",
|
||||||
|
created_at: new Date(),
|
||||||
|
updated_at: new Date(),
|
||||||
|
rules : [
|
||||||
|
"PUT rib"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const collaboratorRules = rules.filter((rule) => rule.namespace === "collaborator");
|
const collaboratorRules = rules.filter((rule) => rule.namespace === "collaborator");
|
||||||
const notaryRules = [...collaboratorRules, ...rules.filter((rule) => rule.namespace === "notary")];
|
const notaryRules = [...collaboratorRules, ...rules.filter((rule) => rule.namespace === "notary")];
|
||||||
const adminRules = [...notaryRules, ...rules.filter((rule) => rule.namespace === "admin")];
|
const adminRules = [...notaryRules, ...rules.filter((rule) => rule.namespace === "admin")];
|
||||||
@ -1904,6 +1937,19 @@ export default async function main() {
|
|||||||
role.uid = roleCreated.uid;
|
role.uid = roleCreated.uid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (const ruleGroup of rulesGroups) {
|
||||||
|
await prisma.rulesGroups.create({
|
||||||
|
data: {
|
||||||
|
name: ruleGroup.name,
|
||||||
|
rules: {
|
||||||
|
connect: ruleGroup.rules?.map((rule) => ({
|
||||||
|
uid: rules.find((r) => r.name === rule)!.uid!,
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
for (const officeRole of officeRoles) {
|
for (const officeRole of officeRoles) {
|
||||||
const officeRoleCreated = await prisma.officeRoles.create({
|
const officeRoleCreated = await prisma.officeRoles.create({
|
||||||
data: {
|
data: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user