Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enum STATUS {
- ACTIVE
- INACTIVE
- }
- enum USER_ROLE {
- USER
- INFLUENCER
- PARTNER
- OWNER
- UPLOADER
- ADMIN
- }
- enum SEX {
- MALE
- FEMALE
- }
- enum SUBSCRIPTION_TYPE {
- MONTHLY
- CREDIT
- FIX
- }
- enum SUBSCRIPTION_STATUS {
- ACTIVE
- INACTIVE
- CANCELED
- PAST_DUE
- }
- enum SUBSCRIPTION_DURATION {
- ONE_MONTH
- SIX_MONTH
- TWELVE_MONTHS
- TWENTY_MONTHS
- INFINITIVE
- }
- enum CANCELATION_TYPE {
- BY_USER
- BY_PAST_DUE
- BY_STORNO
- }
- enum RIGHTOWNER_TYPE {
- AUDIO
- TRANSLATION
- }
- enum MOBILE_OS {
- ANDROID
- IOS
- }
- type User {
- id: ID! @unique
- email: String! @unique
- password: String
- socialId: String @unique
- deviceId: String @unique
- firstName: String
- lastName: String
- role: USER_ROLE! @default(value: "USER")
- billingName: String
- contactName: String
- publisher: String
- taxId: String
- country: String
- zip: String
- city: String
- address: String
- phone: String
- sex: SEX
- age: String
- clientValue: Int @default(value: "0")
- sapiId: Int
- mobileOS: MOBILE_OS
- purchasedBooks: [PurchasedBook!]! @relation(name: "UserPurchasedBook", onDelete: CASCADE)
- subscriptions: [Subscription!]! @relation(name: "UserSubscription", onDelete: SET_NULL)
- listenedChapters: [ListenedChapter!]! @relation(name: "UserListenedChapter", onDelete: SET_NULL)
- status: STATUS @default(value: "INACTIVE")
- isTester: Boolean @default(value: "false")
- code: String
- usedCoupons: [UserCoupon!]! @relation(name: "UserCoupons")
- royalty: UserRoyalty @realation(name: "UserUserRoyalty", onDelete: SET_NULL)
- completedChapters: [CompletedChapter!]!
- listenStatistic: AggregatedUserStatistic @relation(name: "AggregatedUserStatisticUser", onDelete: SET_NULL)
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Book {
- id: ID! @unique
- name: String!
- longName: String
- author: String
- authors: [Author!]! @realation(name: "BookAuthor")
- publisher: Publisher @realation(name: "BookPublisher")
- narrator: Narrator @realation(name: "BookNarrator")
- slug: String
- translator: String
- description: String
- image: String
- isbn: String
- releaseYear: String
- fullLength: String
- categories: [Category!]! @relation(name: "BookCategory")
- tags: [Tag!]! @relation(name: "BookTags")
- chapters: [Chapter!]! @relation(name: "BookChapters", onDelete: CASCADE)
- price: BookPrice! @relation(name: "BookPriceBook", onDelete: CASCADE)
- royalty: [BookRoyalty!]! @relation(name: "BookRoyalty", onDelete: CASCADE)
- isFree: Boolean @default(value: false)
- isSelfProduction: Boolean @default(value: true)
- status: STATUS @default(value: "INACTIVE")
- deletedAt: DateTime
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Chapter {
- id: ID! @unique
- name: String!
- description: String
- file: File @relation(name: "ChapterFile", onDelete: CASCADE)
- book: Book @relation(name: "BookChapters")
- isFirst: Boolean @default(value: false)
- order: Int @default(value: 0)
- status: STATUS @default(value: "INACTIVE")
- createdAt: DateTime!
- updatedAt: DateTime!
- deletedAt: DateTime
- }
- type Category {
- id: ID! @unique
- name: String! @unique
- slug: String @unique
- description: String
- image: String
- books: [Book!]! @relation(name: "BookCategory", onDelete: SET_NULL)
- parent: Category @relation(name: "CategoriesRelation")
- categories: [Category!]!
- @relation(name: "CategoriesRelation", onDelete: SET_NULL)
- rank: Int
- status: STATUS @default(value: "INACTIVE")
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Tag {
- id: ID! @unique
- name: String! @unique
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Narrator {
- id: ID! @unique
- books: [Book] @realation(name: "BookNarrator")
- name: String! @unique
- slug: String @unique
- description: String
- image: String
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type File {
- id: ID! @unique
- name: String
- url: String
- duration: String
- size: Int
- encrypted: Boolean @default(value: false)
- chapter: Chapter! @relation(name: "ChapterFile")
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type PasswordReset {
- id: ID! @unique
- email: String! @unique
- token: String! @unique
- site: String
- notification: Boolean @default(value: true)
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Subscription {
- id: ID! @unique
- orderId: Int! @unique
- user: User! @relation(name: "UserSubscription")
- type: SUBSCRIPTION_TYPE!
- durationMonths: SUBSCRIPTION_DURATION! @default(value: ONE_MONTH)
- credit: Float @default(value: 0)
- monthlyCredit: Int @default(value: 0)
- amount: Int!
- startedAt: DateTime!
- endAt: DateTime
- isRecurring: Boolean! @default(value: false)
- referenceTransactionId: String
- transactions: [Transaction!]!
- @relation(name: "SubscriptionTransactions", onDelete: SET_NULL)
- status: SUBSCRIPTION_STATUS! @default(value: INACTIVE)
- usedCoupon: UserCoupon @relation(name: "UserCouponSubscription")
- purchasedBooks: [PurchasedBook!]! @relation(name: "SubscriptionPurchasedBook")
- listenStatistic: AggregatedSubscriptionListenStatic @relation(name: "SubscriptionAggregatedSubscription")
- canceledBy: CANCELATION_TYPE @default(value: null)
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Transaction {
- id: ID! @unique
- subscription: Subscription!
- @relation(name: "SubscriptionTransactions", onDelete: SET_NULL)
- transactionId: String @unique
- amount: Int!
- message: String
- isPaid: Boolean! @default(value: false)
- invoice: String
- gatewayResponse: String
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type PurchasedBook {
- id: ID! @unique
- user: User! @relation(name: "UserPurchasedBook")
- book: Book!
- subscription: Subscription! @relation(name: "SubscriptionPurchasedBook")
- royalty: RoyaltyBook
- royaltyPrice: Float @default(value: "0")
- royaltyRate: Float @default(value: "0")
- status: STATUS @default(value: INACTIVE)
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type BookPrice {
- id: ID! @unique
- book: Book! @relation(name: "BookPriceBook")
- fullPrice: Int
- credit: Float @default(value: 1)
- acquisitionPrice: Int
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type BookRoyalty {
- id: ID! @unique
- user: User! @relation(name: "RoyaltyBookRightOwner")
- book: Book! @relation(name: "BookRoyalty")
- rate: Int
- fullPrice: Int
- creditPrice: Int
- minuteCharge: Int
- type: RIGHTOWNER_TYPE!
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type UserRoyalty {
- id: ID! @unique
- user: User!
- rate: Int
- couponDiscount: Int
- fullPrice: Int
- creditPrice: Int
- minuteCharge: Int
- logo: String
- shortDescription: String
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type ListenedChapter {
- id: ID! @unique
- user: User! @relation(name: "UserListenedChapter")
- chapter: Chapter!
- stoppedTime: String!
- playedLength: String!
- royalty: RoyaltyBook @relation(name: "RoyaltyBookListenedChapter")
- timestamp: String
- royaltyPrice: Float @default(value: "0")
- royaltyRate: Float @default(value: "0")
- withCoupon: Boolean @default(value: "false")
- withSubscription: Boolean @default(value: "false")
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Option {
- id: ID! @unique
- key: String! @unique
- name: String
- value: String!
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Royalty {
- id: ID! @unique
- date: String!
- owner: User! @relation(name: "UserRoyalty")
- total: Float!
- invoice: String
- isClosed: Boolean @default(value: "false")
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type RoyaltyBook {
- id: ID! @unique
- royalty: Royalty! @relation(name: "RoyaltyRoyaltyBook")
- book: Book! @relation(name: "BookRoyaltyBook")
- type: SUBSCRIPTION_TYPE!
- playedLength: Int
- quantity: Int
- charge: Int
- price: Float
- total: Float
- isSelfProduction: Boolean
- listenedChapters: [ListenedChapter!]! @relation(name: "RoyaltyBookListenedChapter")
- purchasedBooks: [PurchasedBook!]!
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Coupon {
- id: ID! @unique
- code: String! @unique
- owner: User!
- discount: Float!
- isReusable: Boolean @default(value: false)
- used: [UserCoupon]!
- subscriptions: [CouponSubscription]! @relation(name: "CouponSubscriptionCoupon")
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type CouponSubscription {
- id: ID! @unique
- coupon: Coupon @relation(name: "CouponSubscriptionCoupon")
- couponDiscount: Float @default(value: null)
- type: SUBSCRIPTION_TYPE
- durationMonths: SUBSCRIPTION_DURATION
- price: Float
- credit: Float
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type UserCoupon {
- id: ID! @unique
- user: User! @relation(name: "UserCoupons")
- owner: User @relation(name: "CouponUser")
- coupon: Coupon
- discount: Int
- code: String!
- usedAt: DateTime
- subscription: Subscription @relation(name: "UserCouponSubscription")
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type RoyaltyTransaction {
- id: ID! @unique
- royalty: Royalty! @relation(name: "RoyaltyRoylatyTransaction")
- transaction: Transaction! @relation(name: "TransactionRoylatyTransaction")
- type: SUBSCRIPTION_TYPE!
- total: Float
- percent: Int
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Author {
- id: ID! @unique
- books: [Book!]! @realation(name: "BookAuthor")
- name: String!
- slug: String @unique
- description: String
- image: String
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Publisher {
- id: ID! @unique
- name: String!
- books: [Book] @realation(name: "BookPublisher")
- slug: String @unique
- description: String
- image: String
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Favorite {
- id: ID! @unique
- user: User!
- book: Book!
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type CompletedChapter {
- id: ID! @unique
- user: User!
- book: Book!
- chapter: Chapter!
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type AggregatedStatistic {
- id: ID! @unique
- month: String! @unique
- MONTHLY: Int!
- MONTHLY_TRANSACTION: Int!
- CREDIT: Int!
- CREDIT_TRANSACTION: Int!
- FIX: Int!
- FIX_TRANSACTION: Int!
- CANCELLED: Int!
- FREE: Int!
- NEW_USERS: Int!
- NEW_SUBSCRIBER: Int!
- RESUBSCRIBER: Int!
- MONTHLY_AVG: Float!
- COUPON_AVG: Float!
- FREE_AVG: Float!
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type AggregatedDailyListens {
- id: ID! @unique
- day: DateTime! @unique
- ALL_LISTENS: Int!
- MONTHLY_ALL: Int!
- COUPON_ALL: Int!
- FREE_ALL: Int!
- FIX_ALL: Float!
- CREDIT_ALL: Int!
- CREDIT: Int!
- CREDIT_COUPON: Int!
- MONTHLY: Int!
- MONTHLY_COUPON: Int!
- }
- type AggregatedUserStatistic {
- id: ID! @unique
- user: User! @unique @relation(name: "AggregatedUserStatisticUser", onDelete: SET_NULL)
- ALL_IN_LISTENS: Float!
- COUPON_LISTENS: Float!
- ALL_IN_LISTENS_AVG: Float!
- USER_VALUE: Float!
- FREE_LISTENS: Float!
- }
- type AggregatedSubscriptionListenStatic {
- id: ID! @unique
- subscription: Subscription! @relation(name: "SubscriptionAggregatedSubscription")
- ALL_IN_LISTENS: Float!
- COUPON_LISTENS: Float!
- listens: [ListenedBookLengthStatics] @relation(name: "LisenBookAggregation", onDelete: CASCADE)
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type ListenedBookLengthStatics {
- id: ID! @unique
- book: Book!
- subscriptionAggregateions: AggregatedSubscriptionListenStatic! @relation(name: "LisenBookAggregation")
- ALL_IN_LISTENS: Int!
- COUPON_LISTENS: Float!
- }
- type AggregatedBookStatic {
- id: ID! @unique
- book: Book!
- startDate: DateTime!
- endDate: DateTime!
- LISTEN_SUM: Int!
- MONTHLY_SUM: Int!
- COUPON_SUM: Int!
- FREE_SUM: Int!
- }
- type LastListenedBooksPayload {
- id: ID! @unique
- user: User!
- book: Book!
- lastListenedChapter: ListenedChapter
- createdAt: DateTime!
- updatedAt: DateTime!
- }
- type Migration {
- name: String! @unique
- createdAt: DateTime!
- updatedAt: DateTime!
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement