models:
  User:
    table: users
    fields:
      name:
        type: string
        validation: required|string|max:255
      email:
        type: string
        validation: required|email|unique:users,email
      email_verified_at:
        type: timestamp
        nullable: true
      password:
        type: string
        validation: required|string|min:8
      phone:
        type: string
        validation: nullable|string|max:20
      city:
        type: string
        validation: nullable|string|max:100
      membership_status:
        type: enum
        values: [active, inactive, suspended, pending]
        default: pending
        validation: required|in:active,inactive,suspended,pending
      role:
        type: string
        validation: nullable|string|max:50|exists:roles,slug
      profile_photo:
        type: file
        storage_disk: public
        storage_path: users/profiles
        max_size: 2048
        allowed_extensions: [jpeg, jpg, png, gif, webp]
        validation: nullable|image|mimes:jpeg,jpg,png,gif,webp|max:2048
        nullable: true
      ry_path:
        type: string
        validation: nullable|string|max:500
      office_id:
        type: unsignedBigInteger
        nullable: true
      remember_token:
        type: string
        nullable: true
      created_at:
        type: timestamp
        nullable: true
      updated_at:
        type: timestamp
        nullable: true
    relations:
      office:
        type: belongsTo
        model: Office
        foreign_key: office_id
      roles:
        type: belongsToMany
        model: Role
        pivot_table: role_users
      payments:
        type: hasMany
        model: Payment
      events:
        type: hasMany
        model: Event
      projects:
        type: hasMany
        model: Project
      documents:
        type: hasMany
        model: Document

  Role:
    table: roles
    fields:
      name:
        type: string
        validation: required|string|max:255|unique:roles,name
      slug:
        type: string
        validation: required|string|max:255|unique:roles,slug
      created_at:
        type: timestamp
        nullable: true
      updated_at:
        type: timestamp
        nullable: true
    relations:
      users:
        type: belongsToMany
        model: User
        pivot_table: role_users

  Event:
    table: events
    fields:
      title:
        type: string
        validation: required|string|max:255
      slug:
        type: string
        validation: required|string|max:255|unique:events,slug
      description:
        type: text
        validation: nullable|string
      start_datetime:
        type: datetime
        validation: required|date|after:now
      location:
        type: string
        validation: nullable|string|max:255
      type:
        type: enum
        values: [conference, workshop, seminar, networking, training]
        validation: required|in:conference,workshop,seminar,networking,training
      status:
        type: enum
        values: [draft, published, cancelled, completed]
        default: draft
        validation: required|in:draft,published,cancelled,completed
      featured_image:
        type: file
        storage_disk: public
        storage_path: events/images
        max_size: 5120
        allowed_extensions: [jpeg, jpg, png, gif, webp]
        validation: nullable|image|mimes:jpeg,jpg,png,gif,webp|max:5120
        nullable: true
      attachments:
        type: files
        storage_disk: public
        storage_path: events/attachments
        max_size: 10240
        allowed_extensions: [pdf, doc, docx, txt, zip, ppt, pptx]
        max_files: 10
        validation: nullable|array
        nullable: true
      archived:
        type: boolean
        default: false
        validation: required|boolean
      created_at:
        type: timestamp
        nullable: true
      updated_at:
        type: timestamp
        nullable: true
    relations:
      users:
        type: hasMany
        model: User
        foreign_key: office_id

  Project:
    table: projects
    fields:
      title:
        type: string
        validation: required|string|max:255
      slug:
        type: string
        validation: required|string|max:255|unique:projects,slug
      description:
        type: text
        validation: nullable|string
      status:
        type: enum
        values: [planning, in_progress, completed, on_hold, cancelled]
        default: planning
        validation: required|in:planning,in_progress,completed,on_hold,cancelled
      website_url:
        type: string
        validation: nullable|url|max:255
      display_order:
        type: integer
        validation: nullable|integer|min:0
      project_logo:
        type: file
        storage_disk: public
        storage_path: projects/logos
        max_size: 2048
        allowed_extensions: [jpeg, jpg, png, gif, webp, svg]
        validation: nullable|image|mimes:jpeg,jpg,png,gif,webp,svg|max:2048
        nullable: true
      project_files:
        type: files
        storage_disk: public
        storage_path: projects/files
        max_size: 20480
        allowed_extensions: [pdf, doc, docx, txt, zip, ppt, pptx, xls, xlsx]
        max_files: 20
        validation: nullable|array
        nullable: true
      created_at:
        type: timestamp
        nullable: true
      updated_at:
        type: timestamp
        nullable: true

  Payment:
    table: payments
    fields:
      status:
        type: enum
        values: [pending, paid, failed, refunded, cancelled]
        default: pending
        validation: required|in:pending,paid,failed,refunded,cancelled
      method:
        type: enum
        values: [credit_card, bank_transfer, paypal, stripe, cash]
        validation: required|in:credit_card,bank_transfer,paypal,stripe,cash
      transaction_id:
        type: string
        validation: nullable|string|max:255
      amount:
        type: decimal
        precision: 10
        scale: 2
        validation: required|numeric|min:0
      currency:
        type: string
        default: USD
        validation: required|string|size:3
      receipt_path:
        type: file
        storage_disk: public
        storage_path: payments/receipts
        max_size: 5120
        allowed_extensions: [pdf, jpeg, jpg, png]
        validation: nullable|file|mimes:pdf,jpeg,jpg,png|max:5120
        nullable: true
      membership_start_date:
        type: date
        validation: nullable|date
      membership_end_date:
        type: date
        validation: nullable|date|after:membership_start_date
      user_id:
        type: unsignedBigInteger
        validation: required|exists:users,id
      paid_at:
        type: timestamp
        nullable: true
      created_at:
        type: timestamp
        nullable: true
      updated_at:
        type: timestamp
        nullable: true
    relations:
      user:
        type: belongsTo
        model: User
        foreign_key: user_id

  Partner:
    table: partners
    fields:
      name:
        type: string
        validation: required|string|max:255
      website_url:
        type: string
        validation: nullable|url|max:255
      display_order:
        type: integer
        validation: nullable|integer|min:0
      partner_logo:
        type: file
        storage_disk: public
        storage_path: partners/logos
        max_size: 2048
        allowed_extensions: [jpeg, jpg, png, gif, webp, svg]
        validation: nullable|image|mimes:jpeg,jpg,png,gif,webp,svg|max:2048
        nullable: true
      contact_documents:
        type: files
        storage_disk: public
        storage_path: partners/documents
        max_size: 10240
        allowed_extensions: [pdf, doc, docx, txt]
        max_files: 5
        validation: nullable|array
        nullable: true
      created_at:
        type: timestamp
        nullable: true
      updated_at:
        type: timestamp
        nullable: true

  Opportunity:
    table: opportunities
    fields:
      title:
        type: string
        validation: required|string|max:255
      description:
        type: text
        validation: nullable|string
      category:
        type: enum
        values: [job, internship, volunteer, partnership, investment]
        validation: required|in:job,internship,volunteer,partnership,investment
      visibility:
        type: enum
        values: [public, members_only, private]
        default: public
        validation: required|in:public,members_only,private
      application_deadline:
        type: datetime
        validation: nullable|date|after:now
      external_link:
        type: string
        validation: nullable|url|max:255
      featured_image:
        type: file
        storage_disk: public
        storage_path: opportunities/images
        max_size: 3072
        allowed_extensions: [jpeg, jpg, png, gif, webp]
        validation: nullable|image|mimes:jpeg,jpg,png,gif,webp|max:3072
        nullable: true
      attachments:
        type: files
        storage_disk: public
        storage_path: opportunities/attachments
        max_size: 10240
        allowed_extensions: [pdf, doc, docx, txt, zip]
        max_files: 5
        validation: nullable|array
        nullable: true
      created_at:
        type: timestamp
        nullable: true
      updated_at:
        type: timestamp
        nullable: true

  Document:
    table: documents
    fields:
      title:
        type: string
        validation: required|string|max:255
      file_path:
        type: file
        storage_disk: public
        storage_path: documents/files
        max_size: 51200
        allowed_extensions: [pdf, doc, docx, txt, zip, ppt, pptx, xls, xlsx, jpeg, jpg, png, gif]
        validation: required|file|mimes:pdf,doc,docx,txt,zip,ppt,pptx,xls,xlsx,jpeg,jpg,png,gif|max:51200
      visibility:
        type: enum
        values: [public, members_only, private]
        default: members_only
        validation: required|in:public,members_only,private
      created_at:
        type: timestamp
        nullable: true
      updated_at:
        type: timestamp
        nullable: true

  RoleUser:
    table: role_users
    fields:
      user_id:
        type: unsignedBigInteger
        validation: required|exists:users,id
      role_id:
        type: unsignedBigInteger
        validation: required|exists:roles,id
      created_at:
        type: timestamp
        nullable: true
      updated_at:
        type: timestamp
        nullable: true
    relations:
      user:
        type: belongsTo
        model: User
        foreign_key: user_id
      role:
        type: belongsTo
        model: Role
        foreign_key: role_id

  Office:
    table: offices
    fields:
      name:
        type: string
        validation: required|string|max:255
      address:
        type: text
        validation: nullable|string
      city:
        type: string
        validation: nullable|string|max:100
      state:
        type: string
        validation: nullable|string|max:100
      country:
        type: string
        validation: nullable|string|max:100
      postal_code:
        type: string
        validation: nullable|string|max:20
      phone:
        type: string
        validation: nullable|string|max:20
      email:
        type: string
        validation: nullable|email|max:255
      status:
        type: enum
        values: [active, inactive, temporarily_closed]
        default: active
        validation: required|in:active,inactive,temporarily_closed
      created_at:
        type: timestamp
        nullable: true
      updated_at:
        type: timestamp
        nullable: true
    relations:
      users:
        type: hasMany
        model: User
        foreign_key: office_id

controllers:
  User:
    resource: true
    middleware: [auth:sanctum]
    policies: true
    api_resource: true
    validation_requests: true

  Office:
    resource: true
    middleware: [auth:sanctum, admin]
    policies: true
    api_resource: true
    validation_requests: true

  Role:
    resource: true
    middleware: [auth:sanctum, admin]
    policies: true
    api_resource: true
    validation_requests: true

  Event:
    resource: true
    middleware: [auth:sanctum]
    policies: true
    api_resource: true
    validation_requests: true

  Project:
    resource: true
    middleware: [auth:sanctum]
    policies: true
    api_resource: true
    validation_requests: true

  Payment:
    resource: true
    middleware: [auth:sanctum]
    policies: true
    api_resource: true
    validation_requests: true

  Partner:
    resource: true
    middleware: [auth:sanctum, admin]
    policies: true
    api_resource: true
    validation_requests: true

  Opportunity:
    resource: true
    middleware: [auth:sanctum]
    policies: true
    api_resource: true
    validation_requests: true

  Document:
    resource: true
    middleware: [auth:sanctum]
    policies: true
    api_resource: true
    validation_requests: true

routes:
  prefix: api/v1
  middleware: [api, auth:sanctum]
  namespace: App\Http\Controllers\Api\V1

storage:
  default_disk: public
  upload_path: uploads
  max_file_size: 51200
  allowed_extensions: [jpeg, jpg, png, gif, webp, svg, pdf, doc, docx, txt, zip, ppt, pptx, xls, xlsx]

validation:
  strict_mode: true
  file_validation: true
  relationship_validation: true

security:
  csrf_protection: true
  rate_limiting: true
  file_scanning: true
  sanitize_uploads: true
