mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
Add Claim model
This commit is contained in:
parent
4d645ebc04
commit
1a5fd29922
53
backend/src/models/Claim.js
Normal file
53
backend/src/models/Claim.js
Normal file
@ -0,0 +1,53 @@
|
||||
import uuid from 'uuid/v4'
|
||||
|
||||
module.exports = {
|
||||
id: { type: 'string', primary: true, default: uuid },
|
||||
createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
||||
updatedAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
||||
rule: { type: 'string', default: 'latestReviewUpdatedAtRules' },
|
||||
disable: { type: 'boolean', default: false },
|
||||
closed: { type: 'boolean', default: false },
|
||||
belongsTo: {
|
||||
type: 'relationship',
|
||||
relationship: 'BELONGS_TO',
|
||||
target: ['User', 'Comment', 'Post'],
|
||||
direction: 'out',
|
||||
},
|
||||
reported: {
|
||||
type: 'relationship',
|
||||
relationship: 'REPORTED',
|
||||
target: 'User',
|
||||
direction: 'in',
|
||||
properties: {
|
||||
createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
||||
resourceId: { type: 'string', primary: true, default: uuid },
|
||||
reasonCategory: {
|
||||
type: 'string',
|
||||
valid: [
|
||||
'other',
|
||||
'discrimination_etc',
|
||||
'pornographic_content_links',
|
||||
'glorific_trivia_of_cruel_inhuman_acts',
|
||||
'doxing',
|
||||
'intentional_intimidation_stalking_persecution',
|
||||
'advert_products_services_commercial',
|
||||
'criminal_behavior_violation_german_law',
|
||||
],
|
||||
invalid: [null],
|
||||
},
|
||||
reasonDescription: { type: 'string', allow: [null] },
|
||||
},
|
||||
},
|
||||
reviewed: {
|
||||
type: 'relationship',
|
||||
relationship: 'REVIEWED',
|
||||
target: 'User',
|
||||
direction: 'in',
|
||||
properties: {
|
||||
createdAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
||||
updatedAt: { type: 'string', isoDate: true, default: () => new Date().toISOString() },
|
||||
disable: { type: 'boolean', default: false },
|
||||
closed: { type: 'boolean', default: false },
|
||||
},
|
||||
},
|
||||
}
|
||||
@ -13,4 +13,5 @@ export default {
|
||||
Tag: require('./Tag.js'),
|
||||
Location: require('./Location.js'),
|
||||
Donations: require('./Donations.js'),
|
||||
Claim: require('./Claim.js'),
|
||||
}
|
||||
|
||||
7
backend/src/seed/factories/claims.js
Normal file
7
backend/src/seed/factories/claims.js
Normal file
@ -0,0 +1,7 @@
|
||||
export default function create() {
|
||||
return {
|
||||
factory: async ({ args, neodeInstance }) => {
|
||||
return neodeInstance.create('Claim', args)
|
||||
},
|
||||
}
|
||||
}
|
||||
@ -10,6 +10,7 @@ import createLocation from './locations.js'
|
||||
import createEmailAddress from './emailAddresses.js'
|
||||
import createDonations from './donations.js'
|
||||
import createUnverifiedEmailAddresss from './unverifiedEmailAddresses.js'
|
||||
import createClaim from './claims.js'
|
||||
|
||||
const factories = {
|
||||
Badge: createBadge,
|
||||
@ -23,6 +24,7 @@ const factories = {
|
||||
EmailAddress: createEmailAddress,
|
||||
UnverifiedEmailAddress: createUnverifiedEmailAddresss,
|
||||
Donations: createDonations,
|
||||
Claim: createClaim,
|
||||
}
|
||||
|
||||
export const cleanDatabase = async (options = {}) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user